黑马程序员技术交流社区

标题: 【求助】学习数组反射时候一个编译错误 [打印本页]

作者: 林豪    时间: 2012-5-20 14:38
标题: 【求助】学习数组反射时候一个编译错误
int [] a1 = new int[3];
                int [] a2 = new int[4];
                int[][] a3 = new int[3][4];
                String[] a4 = new String[3];
                System.out.println(a1.getClass() == a2.getClass());
                System.out.println(a1.getClass() == a3.getClass());  //编译错误:Incompatible operand types Class<capture#8-of ? extends int[]> and Class<capture#9-of ? extends int[][]>
                System.out.println(a1.getClass() == a4.getClass());  //编译错误:Incompatible operand types Class<capture#10-of ? extends int[]> and Class<capture#11-of ? extends String[]>
求解原因呀!!!我看张老师写的好好的
作者: 李哲    时间: 2012-5-20 14:57
以前我问过这个问题。
似乎是Jdk版本问题。
下面是我以前问的网址。
http://bbs.itheima.com/thread-11581-1-1.html




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2