- package cn.itcast.day1;
- public class ReflectTest6
- {
- 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[3];
-
- System.out.println(a1.getClass() == a2.getClass());
- <font color="red">System.out.println(a1.getClass() == a3.getClass()); // 老师写的这个程序没有任何问题,可以运行出来,可是为什么同样的代码我的eclipse编译通不过呢?
- System.out.println(a1.getClass() == a4.getClass()); //Incompatible operand types Class<capture#3-of ? extends int[]> and Class<capture#4-of ? extends int[][]></font>
- System.out.println(a1.getClass().getName());
- }
- }
复制代码 |
|