黑马程序员技术交流社区
标题:
关于反射的代码,为什么最后两行会报错
[打印本页]
作者:
mmakun
时间:
2015-5-29 18:13
标题:
关于反射的代码,为什么最后两行会报错
public static void main(String[] args) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
// TODO Auto-generated method stub
//Method aMethod=a.class.getMethod("main", String[].class);
//aMethod.invoke(null, (Object)new String[]{"11"});
int[] a1=new int[3];
int[] a2=new int[]{2,5,3,6};
String[] a3=new String[4];
int[][] a4=new int[3][4];
System.out.println(a1.getClass()==a2.getClass());
System.out.println(a1.getClass()==a3.getClass());
System.out.println(a3.getClass()==a4.getClass());
}
}
复制代码
为什么最后 两行会报错,百思不得解
作者:
cyaimyt
时间:
2015-6-4 07:55
我看看先
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2