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