private member access
Hi !
I have a class in which there are some private and some public data members. I want to get the name of each data member ( public as well as private ) along with its data type in order to put this information in vector. Vector is in the same class.
how can I do this? does ne 1 know the ans?
-Vaibhav.
[339 byte] By [
v_sanas] at [2007-9-26 20:47:18]

Hi, Check out the java.lang.reflect package.Reflection allows you to have info about the fields , methods , constructors of a loaded class .Hope this helps,Manish
java.lang.Class contains methos for accessing the field names. The method is your classname.getClass().getDeclaredField(String name) This method return a field object.For getting the type, Above FieldObject.getType() returns the type of your field.