泛型接口-2
interface interfaceDemo<T>{
public void show(T t);
}
class demo implements interfaceDemo<String> {
public void show(String t) {
System.out.println(t);
}
}
public class test {
public static void main(String[] args) {
demo d = new demo();
d.show("Hello");
}
}
Console:
Hello