作者: yinxjfly 时间: 2014-6-13 21:50
public class GenericDemo {
public static void main(String[] args) {
Set<String> a = new HashSet<String>();
Set<String> a1 = new HashSet<String>();
Set<Integer> b = new HashSet<Integer>();
/*String a = new String("asda");
Integer b = new Integer(12); */
show(a, b);
}
public static void show(Set<?> a, Set<?> b){
System.out.println(a.getClass().getName());
System.out.println(b.getClass().getName());
}
}
我觉得这样写就了没什么问题了!