泛型接口的实现方式之二
inte易做图ce Info<T>{ public T getvar(); } class Infodemo implements Info<String>{ private String var; public Infodemo(String var){ this.var = var; } public void setVar(String var){ this.var = var; } @Override public String getvar() { // TODO Auto-generated method stub return this.var; } } public class Pet{ public static void main(String args[]){ Info<String> var = new Infodemo("李兴华"); System.out.println("内容:"+var.getvar()); } }
补充:软件开发 , Java ,