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 are class members by default?

1084


What is the largest number a double can hold?

1047


Is java a super set of javascript?

1105


What is treeset in java collection?

971


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

1243


Can a source file contain more than one class declaration?

997


What is the difference between a window and a frame in java programming?

1139


How many tetrahedral voids are there in bcc?

1097


Why is java so popular?

1119


What is the difference between object oriented programming language and object based programming language?

1018


How will you compute size of a structure?

1184


What do you mean by order of precedence and associativity?

950


What is a instance variable?

1063


how many types of Inheritance?

1176


Explain the use of sublass in a java program?

1025