next up previous index
Next: Bounds on types Up: Generics in Java 5 Previous: The Iterable interface and   Index

Typing an order relation

The remainder of this chapter considers some further syntax for type parameters. The main aim is to understand why our SearchTree class, for instance, is typed using the initially surprising syntax

SearchTree<E extends Comparable<? super E>>
to indicate that the elements of a SearchTree must belong to a class implementing a suitable order relation.



Subsections

Peter Williams 2005-06-07