本帖最后由 王进亮 于 2012-12-23 20:21 编辑
在24_黑马程序员_张孝祥老师_Java基础加强_数组与Object的关系及其反射类型中
我照抄的,为什么不行
public class ReflectTest1 {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
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());
System.out.println(a1.getClass() == a4.getClass());//错误提示:Incompatible operand types Class<capture#3-of ? extends int[]> and Class<capture#4-of ? extends
System.out.println(a1.getClass() == a3.getClass());//错误提示:Incompatible operand types Class<capture#5-of ? extends int[]> and Class<capture#6-of ? extends int[]
}
}
帮个忙啊.........急...........
|
|