Close

Java Reflection - Class.isEnum() Examples

Code Snippets Java Reflection Java 


Class:

java.lang.Class

java.lang.Objectjava.lang.Objectjava.lang.Classjava.lang.Classjava.io.SerializableSerializablejava.lang.reflect.GenericDeclarationGenericDeclarationjava.lang.reflect.TypeTypejava.lang.reflect.AnnotatedElementAnnotatedElementLogicBig

Method:

public boolean isEnum()
Returns:
true if and only if this class is an enum


Examples


package com.logicbig.example.clazz;

public class IsEnumExample {

public static void main(String... args) {
Class<Thread.State> c = Thread.State.class;
boolean b = c.isEnum();
System.out.println(b);

}
}

Output

true




See Also