class A<T> { private T value; public A(T value) { this.value = value; } public T getValue() { return value; } public void setValue(T value) { this.value = value; } } public class GenericDemo01 { public static void main(String args[]){ A<String>a = new A<String>("呵呵"); System.out.println(a.getValue()); } }