In my application, i want to print out a variable´s value AND its name, if possible.
For example:
int testinteger = 0;
String type = > type of testinteger? (int);
String name = > name of testinteger? (testinteger);
System.out.println("The "+type+" "+name+" has a value of"+ testinteger);
So i want to read: The int testinteger has a value of 0
Unfortunately, i suppose, it is not possible with primitive types. But is it also the case for types like String
, Integer
, Boolean
etc.? Is there any possibility to get it?