OnJava8-Examples/generics/RestrictedComparablePets.java
2015-09-07 11:44:36 -06:00

14 lines
325 B
Java

// generics/RestrictedComparablePets.java
// ©2015 MindView LLC: see Copyright.txt
class Hamster extends ComparablePet
implements Comparable<ComparablePet> {
public int compareTo(ComparablePet arg) { return 0; }
}
// Or just:
class Gecko extends ComparablePet {
public int compareTo(ComparablePet arg) { return 0; }
}