Quote
then when would I use the remove student class?
I dint get what you mean here?
If the class is comparable, then he have to implements Comparable interface. But the implemented equals() can do the work here and he has a thread about that .
So calling the equals() method will do the trick. The doc said about implementing compareTo()
Quote
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

New Topic/Question
Reply




MultiQuote



|