Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the synonym of string?

1035


What is javac_g?

968


What is the benefit of inner classes in java?

1039


Why is logger singleton?

1011


What are three ways in which a thread can enter the waiting state in java programming?

1093


Do I need java on my computer?

922


What is the major difference between linkedlist and arraylist?

963


What is the difference between char and char *?

1005


Which are different kinds of source code?

1051


Can a constructor have different name than a class name in java?

1083


Explain the hierarchy of java exception classes?

1021


Explain the importance of throwable class and its methods?

990


Can an integer be null java?

934


What is defined as false sharing in the context of multithreading?

983


How to display names of all components in a Container?

2889