OnJava8-Examples/generics/HijackedInterface.java

10 lines
320 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/HijackedInterface.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
// {CompileTimeError} (Won't compile)
class Cat extends ComparablePet implements Comparable<Cat>{
// Error: Comparable cannot be inherited with
// different arguments: <Cat> and <Pet>
public int compareTo(Cat arg) { return 0; }
} ///:~