This discussion is archived
1 Reply Latest reply: Oct 14, 2010 2:34 PM by asrivast RSS

compareTo implementation with Generics

asrivast Newbie
Currently Being Moderated
Hi,
I have an interface like:
public interface MyInterface<V extends Val<V>> extends Comparable<MyInterface<V>> {...}

and implementation as:
public class MyImp <V extends Val> implements MyInterface {
// -- How should my compareTo look like if I use MyInterface instead of an Object?
public int compareTo (Object o) {
}
}

I want to use compareTo(MyInterface m) instead of compareTo (Object o).

Thanks for the help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points