jose chiramal wrote:Ok thanks for the explanation, similar to how we have two or three classes implementing the Comparator interfaces, can we not have more than one class implementing comparable interface and thereby have multiple sort sequences ?
If you have 3 classes, and all implements Comparable, you will get 3 classes with different sort sequences.
But using Comparator<T>, you can have 100 Sort sequences for the same class if you want! With Comparable<T> there will always be one sort sequence for one class!
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator