class Super {} class Sub extends Super {} public class Main { static void test1() { List<? extends Super>s = new ArrayList<Sub>(); s.add(new Super()); //あ s.add(new Sub()); //い } static void test2() { List<? super Sub>s = new ArrayList<Super>(); s.add(new Super()); //う s.add(new Sub()); //え } public static void main(String args[]) { test1(); test2(); } }