Besides parameterized interface types and parameterized class types, Java 5 also permits parameterized methods. So the last two examples can be rewritten as:
0899: private static <GType> void printList6(List<GType> pList) 0900: { 0901: for (GType tGType : pList) 0902: { 0903: System.out.println(tGType); 0904: } 0905: } 0906: private static <GShape extends Shape> void printList7(List<GShape> pList) 0907: { 0908: for (GShape tGShape : pList) 0909: { 0910: System.out.println("X is " + tGShape.getX()); 0911: } 0912: }