本帖最后由 黑马-李勇 于 2012-9-4 16:15 编辑
Class c3=Integer.class;
Class c4=Integer.TYPE;
Class c5=String.class;
//System.out.println("c1:"+c1);
//System.out.println("c2:"+c2);
System.out.println("c3:"+c3);
System.out.println("c4:"+c4);
System.out.println("c5:"+c5);
String a="abc";
Class c6=Class.forName("java.long.String"); //这句就出问题。
结果是:
Exception in thread "main" java.lang.ClassNotFoundException: java.long.String
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at lianxi.filewriter.main(filewriter.java:31)
|