//用instanceof判断类的类型
public class SecondDay {
/**
* auther: * version:3.5.1
* @param
* JDK version used7.1.0
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
byte a = 5;
Object obj = a - 2;
if(obj instanceof Double)
{
System.out.println("Double");
}
else if(obj instanceof Float)
{
System.out.println("Float");
}
else if(obj instanceof Integer)
{
System.out.println("Integer");
}
else if(obj instanceof Long)
{
System.out.println("Long");
}
else
{
System.out.println("Byte");
}
}
}