@Target(value={TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE}) @Retention(value=SOURCE) public @interface SuppressWarnings
作为一个风格的问题,程序员应该总是使用这个注释对最深嵌套的元素,它是有效的。如果你想在一个特定的方法中抑制警告,你应该注释该方法,而不是它的类。
public abstract String[] value
字符串"unchecked"
用来抑制制止警告。编译器供应商应记录他们支持的额外的警告名称与此注释类型一起使用。鼓励他们合作,以确保在多个编译器相同的名称工作。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.