Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can a class extend and implement???

807580Apr 19 2010 — edited Apr 20 2010
Hi all, is it possible to have a class that extends another class but also implements Comparable? I am trying to do this but get compilation error

public class Student extends Person implements Comparable<Student>
public class Person implements Comparable<Person>
These are my two classes which are being used...

java.lang.Comparable cannot be inherited with different arguments+
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2010
Added on Apr 19 2010
7 comments
237 views