How to suppress Java compiler warnings for specific functions

前端 未结 5 868
暗喜
暗喜 2020-12-03 10:28

We are always taught to make sure we use a break in switch statements to avoid fall-through.

The Java compiler warns about these situations to help us not m

5条回答
  •  遥遥无期
    2020-12-03 10:40

    If you really, really must do this, and you are sure you are not making a mistake, check out the @SuppressWarnings annotation. I suppose in your case you need

    @SuppressWarnings("fallthrough")
    

提交回复
热议问题