摘要:学习java我并没有学习eclipse,所以当用eclipse时,系统报错我并知道程序哪里出错了..昨晚在做程序时才对此有了初步了解.......Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer红色字体解释了异常的具体情况.Test.getListValue.remove(getListValue.java:39)点击红色字体会显示具体的错误行
阅读全文
摘要:JAVA对象转型必须两者是父类和子类关系,或者是父类和间接子类的关系,一下例子:Object x = new Integer(0); System.out.println((String)x);x指向整型包装类,但第二条语句(String)x,这个就是错误的,Integer和String不是子类和父类关系..
阅读全文
摘要:===========================package J2EE;public class Node { public Object value; public Node left; public Node right; public Node(){ this.left=null; this.right=null; this.value=null; } public Node(Object value){ this.value=value; this.left=null; this.right=null; } public Node(Object value,Node left,
阅读全文