class VarType_Java {
public static void main(String[] args) {
Object o1 = "Java";
if (o1 instanceof String) {
System.out.println("o1 is a String");
}
Object o2 = 9320;
String dataType = o2.getClass().getName();
System.out.println("o2 is " + dataType);
Object o3 = 3.14;
dataType = o3.getClass().getName();
System.out.println("o3 is " + dataType);
int a = 783;
System.out.println(((Object)a).getClass().getName());
char b = 'a';
System.out.println(((Object)b).getClass().getName());
double c = 943498.083;
System.out.println(((Object)c).getClass().getName());
String d = "abc";
System.out.println(((Object)d).getClass().getName());
boolean e = true;
System.out.println(((Object)e).getClass().getName());
}
}
/*
run:
o1 is a String
o2 is java.lang.Integer
o3 is java.lang.Double
java.lang.Integer
java.lang.Character
java.lang.Double
java.lang.String
java.lang.Boolean
*/