Mega Code Archive

 
Categories / Java Book / 008 Reflection
 

0447 Get the class for this field

Class<?> getDeclaringClass() Returns the Class object representing the class or interface that declares the field. Object get(Object obj) Returns field value boolean getBoolean(Object obj) Gets field value as boolean. byte getByte(Object obj) Gets field value as byte. char getChar(Object obj) Gets field value as char. double getDouble(Object obj) Gets field value as double. float getFloat(Object obj) Gets field value as float. Type getGenericType() Returns a Type object that represents the declared type for the field represented by this Field object. int getInt(Object obj) Gets field value as int. long getLong(Object obj) Gets field value as long. short getShort(Object obj) Gets field value as short.