In Java, is it possible to print the type of a variable?
public static void printVariableType(Object theVariable){ //print the type of the variable that
You can read in the class, and then get it's name.
Class objClass = obj.getClass(); System.out.println("Type: " + objClass.getName());