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