Diff between Comparator and Comparable?
Answer Posted / rajesh
Comparable interface uses Object's compareTo() to compare
the objects. We have to override the compareTo() method in
order to sort.
Where as Comparator, checks for compare() method. You can
sort based on particular property of the object.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
define the terminology association.
What is the purpose class.forname method?
What does a method signature consist of?
What is the difference between processes and threads?
Why does java not allow multiple public classes in a java file ?
Write a program to check string is palindrome without using loop?
What are the main differences between the java platform and other platforms?
Can we make main() thread as daemon?
difference between byte stream class and character stream class?
What are passing parameters?
Which is faster set or list in java?
Can you change array size in java?
What is object class in java?
Is java written in c?
what is the constructor and how many types of constructors are used in java?