Let\'s say I declare a variable:
String a = \"test\";
And I want to know what type it is, i.e., the output should be java.lang.String
java.lang.String
If you want the name, use Martin's method. If you want to know whether it's an instance of a certain class:
boolean b = a instanceof String