Java Method getAnnotation() MethodThe getAnnotation() method of Method class returns this element's annotation if such an annotation is present for the specified type, otherwise returns null. SyntaxParameterannotationClass - the Class object corresponding to the annotation type ReturnsThis element's annotation if present on this element, otherwise null. ThrowsNullPointerException Example 1Test it NowOutput: Demo_Annotation 100 Example 2Test it NowOutput: name_: getSplField value_: Sample Method Annotation
Next TopicJava Method Class
|