本帖最后由 HM谢文辉 于 2013-3-23 09:59 编辑
看基础加强视频《数组与Object急其反射类型》,老师代码可以编译通过我的却不能。代码如下:
int [] a1 = new int[3];
int [][] a3 = new int[2][3];
String [] a4 = new String[3];
System.out.println(a1.getClass() == a3.getClass()); //出错
System.out.println(a1.getClass() == a4.getClass()); //出错
出错提醒:Incompatible operand types Class<capture#8-of ? extends int[]> and Class<capture#9-of ? extends int[][]>
Incompatible operand types Class<capture#10-of ? extends int[]> and Class<capture#11-of ? extends String[]>
|