- public class Test03_shuzu {
- public static void main(String[] args) {
- int[] a1=new int[3];
- int[] a2=new int[4];
- int[][] a3=new int[2][3];
- String[] a4=new String[5];
-
- System.out.println(a1.getClass() == a2.getClass());
- System.out.println((a1.getClass()==a3.getClass()));
- System.out.println(a1.getClass() == a4.getClass());
-
- }
- }
复制代码 就是张老师的代码,jdk1.4可以,我用的是jdk1.7
报错:
编译器报错:Incompatible operand types Class<capture#3-of ? extends int[]> and Class<capture#4-of ? extends int[][]>
应该是新的JDK中加强了这方面的语法机制,但为啥要这样?不就是比较下两个字节码嘛,字节码是可比较的呀 |