Following is a class:
class Test{
int x;
}
Now let's say I make an object of the class:
Test testObj = new Test();
Also, I have a String variable, which has the same value as the class variable:
String var = "x";
Now from this object testObj
is there a way, that if I supply the name of the variable through the string var
, and get the data type of variable x?