OnJava8-Examples/generics/HijackedInterface.java
2016-01-25 18:05:55 -08:00

17 lines
500 B
Java

// generics/HijackedInterface.java
// (c)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 <ComparablePet>
// class Cat
// ^
// 1 error
public int compareTo(Cat arg) { return 0; }
}