// generics/SixTupleTest.java
// TIJ4 Chapter Generics, Exercise 3, page 624
// Create and test a SixTuple generic.
import net.mindview.util.*;
class Robot {}
class Amphibian {}
class Vehicle {}
class SixTuple
extends FiveTuple {
public final F sixth;
public SixTuple(A a, B b, C c, D d, E e, F f) {
super(a, b, c, d, e);
sixth = f;
}
public String toString() {
return "(" + first + ", " + second + ", " +
third + ", " + fourth + ", " + fifth + ", " + sixth +")";
}
}
public class SixTupleTest {
static SixTuple f() {
return new SixTuple(
new Robot(), new Vehicle(), new Amphibian(), "hi", 47, 11.1);
}
public static void main(String[] args) {
SixTuple st = f();
System.out.println(st);
System.out.println(f());
}
}