package result;
//泛型小例子,本质类似于c++的模板
interface Tt<T>{
public void show(T t);
}
class Student1{
String name;
int age;
int num;
}
class Teacher{
String name;
int age;
int num;
}
public class F8<T> implements Tt<T>{
@Override
public void show(T t) {
// TODO Auto-generated method stub
System.out.println("t的类型是:"+t.getClass());
}
public static void main(String[] args) {
F8 f8 = new F8();
Student1 student = new Student1();
f8.show(student);
}
}