12 lines
450 B
Java
12 lines
450 B
Java
// generics/HijackedInterface.java
|
|
// ©2016 MindView LLC: see Copyright.txt
|
|
// We make no guarantees that this code is fit for any purpose.
|
|
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
|
|
// {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; }
|
|
}
|