How do i get the name of avariable (Urgent!!!)

I want to be able to get the name of a variable, please how do i do that?
[87 byte] By [dupsy] at [2007-9-26 2:34:48]
# 1

I'm not 100% sure I know what you mean. Do you have a random object and need to get the variable names out of it?

Object.getClass().getDeclaredFields will return a Field[] of all fields declared in a class.

Object.getClass().getFields() will return a Field[] of all accessible fields in the object.

You can then walk the array and pick out the field you want.

For more info look in the Javadoc for java.lang.Class

alan.mck at 2007-6-29 10:00:02 > top of Java-index,Archived Forums,New To Java Technology Archive...