第二阶段28--泛型_泛型接口
//接口 public interface Igeneric<T> { T getName(T name); } //实现接口类 public class IgenericImpl implements Igeneric<String>{ @Override public String getName(String name){ return name; } } public class Test2 { public static void main(String[]args){ IgenericImpl I = new IgenericImpl(); //接口实现类 String name = I.getName("asfs"); System.out.println(name); Igeneric<String> igeneric = new IgenericImpl(); //接口 String name1 = igeneric.getName("fdkfdk"); System.out.println(name1); } }