//Java 方法返回值前面的T是什么 TODO 它的作用是定义泛型 class Show{ public void print1(T t){ System.out.println(t); } public void print2(T t){ System.out.println(t); } } class Demo{ public static void main(String[] args) { Show stringShow = new Show<>(); // stringShow.print1(new Integer(1));//编译不通过 stringShow.print2(new Integer(1)); } }



