Java Class isAnnotationPresent() MethodThe isAnnotationPresent() method of java Class class returns true if an annotation for the specified type is present on this element, false otherwise. SyntaxParameterannotationClass - the Class object corresponding to the annotation type Returnstrue if an annotation for the specified annotation type is present on this element. ThrowsNullPointerException Example 1Test it NowOutput: Check isAnnotationPresent ::: false Example 2Test it NowOutput: Check isAnnotationPresent ::: true
Next TopicJava Class
|