摘要:
public class Generic1<T> { private T name; public void get(T name){ this.name = name; } public T show(){ return this.name; } } public class get { publ 阅读全文
摘要:
public class MethodGeneric1 { public <T> void method(T...args){ for(T t:args){ System.out.println(t); } } } public class Test4 { public static void ma 阅读全文
摘要:
//非静态方法使用泛型public class MethodGeneric { public<T> void getName(T name){ System.out.println(name); } public <T> T putName(T name){ return name; } } pub 阅读全文
摘要:
//接口 public interface Igeneric<T> { T getName(T name); } //实现接口类 public class IgenericImpl implements Igeneric<String>{ @Override public String getNam 阅读全文
摘要:
public class Generic<T> { private T flag; public void setFlag(T flag){ this.flag = flag; } public T getFlag(){ return this.flag; } } public class Test 阅读全文
摘要:
public class TestEnum { public static void main(String[ ] args) { // 枚举遍历 for (Week k : Week.values()) {//values获取枚举所有对像 System.out.println(k); } // s 阅读全文