According to the Java Oracle tutorial , if using an obsolete method marked with @Deprecated annotations, the compiler should give a compilation warning. But with the following code example, I don't get a warning in the console.
Used Java Version: 1.8.0_112
Please let me know what is missing here. Thank.
public class PreDefinedAnnotationTypesTest {
@Deprecated
public void m1(){
}
public static void main(String[] args) {
PreDefinedAnnotationTypesTest obj = new PreDefinedAnnotationTypesTest();
obj.m1();
}
}
source
share