//仅作为学习笔记
//泛型接口
/*
泛型定义在接口上
*/
interface Inter<T>
{
public void show(T t);
}
/*
class InterImp implements Inter<String>
{
public void show(String t)
{
System.out.println("show :"+ t);
}
}
*/
class InterImp2<T> implements Inter<T>
{
public void show(T t)
{
System.out.println("show<T> :" + t);
}
}
class TestDemo
{
public static void main(String []args)
{
// InterImp i = new InterImp();
// i.show("hah");
InterImp2<Integer> i= new InterImp2<Integer>();
i.show(2);
}
}