62,614
社区成员
发帖
与我相关
我的任务
分享
List<? extends Fruit> flist = new ArrayList<Apple>();
// Compile Error: can't add any type of object:
// flist.add(new Apple());
// flist.add(new Fruit());
// flist.add(new Object());
flist.add(null);
List<? super Apple> list = new ArrayList<Fruit>();
list.add(new Apple());
// Compile Error: can't add any type of object
//list.add(new Fruit());
list.add(new Fujin());