// generics/TupleList.java // ©2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Combining generic types to make complex generic types. import java.util.*; import onjava.*; public class TupleList extends ArrayList> { public static void main(String[] args) { TupleList tl = new TupleList<>(); tl.add(TupleTest.h()); tl.add(TupleTest.h()); for(Tuple4 i: tl) System.out.println(i); } } /* Output: (Vehicle@139a55, Amphibian@1db9742, hi, 47) (Vehicle@106d69c, Amphibian@52e922, hi, 47) */