Java Class.isAnnotation()
Syntax
Class.isAnnotation() has the following syntax.
public boolean isAnnotation()
Example
In the following code shows how to use Class.isAnnotation() method.
/*from w ww . ja v a 2 s . c o m*/
public class Main{
public static void main(String[] unused) {
try {
String n = "java.lang.Deprecated";
Class c = Class.forName(n);
System.out.println(c.isAnnotation());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
The code above generates the following result.