Java Class getDeclaredAnnotation() MethodThe getDeclaredAnnotation() method of java Class class returns this element's annotation for the specified type if any annotation is directly present otherwise null. SyntaxParameterannotationClass - the Class object corresponding to the annotation type Returnsannotation for the specified annotation type ThrowsNullPointerException Example 1Test it NowOutput: @java.lang.Deprecated() null Example 2Test it NowOutput: @java.lang.Deprecated() null null null Next TopicJava Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India