标签:异常 java ati test not color logs 类型转换 pre
public class TestException {
public static void main(String[] args) {
Object obj = new Integer(1);
int i =(Integer)(obj);
System.out.println(i);
Object object = new Object();
if (object instanceof Integer){
System.out.println(true);
}
int j = (Integer)object;
System.out.println(j);
}
}
1 Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.Integer at TestException.main(TestException.java:8)
标签:异常 java ati test not color logs 类型转换 pre
原文地址:http://www.cnblogs.com/BaiLaowu/p/7092331.html