Is this possible!!?!?!?!?
I\'m trying to make a set of classes that model a number of different types of things. Properties of these things change over time, and I want
It's not possible to do that kind of reflection. Variable names could be erased by the compiler depending on debugging options and scope. The name of a variable is an alias of its "address" so can not be reversed (at least in Java and C# AFAIK).
An object can be pointed from nay variables, so the variable name is irrelevant and the object don't know this kind of stuff:
Cat tiger = new Cat();
Cat tiger2 = tiger;
Variable tiger2
points to the Cat
"tiger", so 2 variable points same object with different names.
Use class properties passed in the constructor.