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
Use operator overloading feature of java
class Test { void printType(String x) { System.out.print("String"); } void printType(int x) { System.out.print("Int"); } // same goes on with boolean,double,float,object ... }