Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0430 Check the class type

boolean isAnnotation() is it an annotation type. boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) Is an annotation present. boolean isAnonymousClass() Is it an anonymous class. boolean isArray() Is it an array class. boolean isAssignableFrom(Class<?> cls) Is it assigned from. boolean isEnum() Is it an enum. boolean isInstance(Object obj) Is it instance of another object. boolean isInterface() Is it an interface type. boolean isLocalClass() Is it a local class. boolean isMemberClass() Is it a member class. boolean isPrimitive() Is it a primitive type. boolean isSynthetic() Is it a synthetic class.