package c.cn.itcast.generic; import java.util.List; // template public class Generic<T> { // 泛型方法 T t; public Generic(T t) { this.t = t; } public T getT() { return t; } public void print(int a) { System.out.println(a); } public void print(List<T> list) { System.out.println(list); } }