// Contravariance in Java 1.8 class person implements Comparable { public String name; public int compareTo(person x) {return name.compareTo(x.name);} } class student extends person implements Comparable { public double gpa; // public int compareTo(person x) {return name.compareTo(x.name);} // can the compareTo method be inherited? } //class C> // usual form class C> // new jdk 1.8 form { static void notreallymain() { C y = new C(); // won't compile without "super" // C z = new C(); // but can't be covariant } } // what if I try to do a super on a return type? -- following won't compile /* interface D { T f(); } class DD implements D { public person f() { return null; } } class CC> { static void stillnotmain() { CC x = new CC(); } } */