Generics in Java, using wildcards
问题 I have a question about Generics in Java, namely using wildcards. I have an example class GenClass like this: public class GenClass<E> { private E var; public void setVar(E x) { var = x; } public E getVar() { return var; } } I have another simple class: public class ExampleClass { } I have written the following test class: public class TestGenClass { public static void main(String[] str) { ExampleClass ec = new ExampleClass(); GenClass<ExampleClass> c = new GenClass<ExampleClass>(); c.setVar