为什么在jdk1.7版本第7行和第8行会报错,张老师在1.5版本就不会报错?
Java Code
1
2
3
4
5
6
7
8
9
|
| int[] a1 = new int[1];
int[] a2 = new int[2];
int[][] a3 = new int[3][4];
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()); //错误
|
|
|