How to suppress Java compiler warnings for specific functions

前端 未结 5 878
暗喜
暗喜 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:46

    Is the annotation @SuppressWarnings (javadoc) what you are looking for?

    For example:

    @SuppressWarnings("unchecked")
    public void someMethod(...) {
        ...
    }
    

提交回复
热议问题