1 package test; 2 3 public class Test<X extends Number , Y extends RuntimeException > extends java.util.AbstractList <X> { 4 5 private X singleton; 6 7 public X get(int index) { 8 return singleton; 9 } 10 11 public int size() { 12 return 1; 13 } 14 15 public static void main(String ... args) { 16 Generics<? extends Number > tn; 17 Generics<Integer > ti; 18 ti.get(0).intValue(); 19 tn.get(0).intValue(); 20 } 21 } | Popular Tags |