13 lines
291 B
Java
13 lines
291 B
Java
//: generics/RestrictedComparablePets.java
|
|
|
|
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; }
|
|
} ///:~
|