Programmers are usually confused between "Comparable" and "Comparator" interface. Comparable interface has "compareTo" method which is normally used for natural ordering but Comparator interface has "compare" method which takes two arguments. It can be used where you want to sort objects based of more then one parameter. Following example will make it more clear. Java Code: package test;/* ** Use the Collections.sort to ...
package test;/* ** Use the Collections.sort to
thanks...
sorry for all the questions
thanks...
06-14-2013, 02:22 PM in gbonecapone