OnJava8-Examples/generics/RestrictedComparablePets.java

14 lines
332 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/RestrictedComparablePets.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
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; }
} ///:~