Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fruit {...}
- class Apple extends Fruit implements Comparable<Apple> {...}
- // apples are only comparable to apples
- class Fruit implements Comparable<Fruit> {...}
- class Apple extends Fruit {...}
- // comparable to any fruit or subclass
- //to accommodate the second example:
- <T extends Comparable<? super T>> T max(Collection<? extends T> coll)
- // the type parameter is read as: my type is a subtype of a Comparable that takes in and return a type that is a supertype to T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement