/**Created by Archer on 2016/3/29.*/public class GenericDemo02 { public static void main(String[] args) { Con<String> c= new Con<String>("Archer"); System.out.println(c.getValue()); System.out.println("hello"); }}class Con<T>{ private T value; public Con(T value) { this.value = value; } public T getValue() { return value; } public void setValue(T value) { this.value = value; }}编译器报错,jdk1.8Exception in thread "main" java.lang.NoClassDefFoundError: Con at GenericDemo02.main(GenericDemo02.java:7) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)Caused by: java.lang.ClassNotFoundException: Con at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 6 more
添加回答
举报
0/150
提交
取消