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 / qim2010

The “Comparable” interface allows itself to compare with
another similar object (i.e. A class that implements Comparable
becomes an object to be compared with). The following method
are specified in the interface.

public int compareTo(Object o)
public int compareToIgnoreCase(String str)

The "Comparator" interface is used to compare two different
objects. The following method is specified in the Comparator
interface.

public int compare(Object o1, Object o2)

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps involved to create a bean?

1158


Which is the best approach for creating thread ?

1216


What is oops in java?

1021


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

1010


What is finally and finalize in java?

1094


What are the main concepts of oops in java?

1747


What are dot operator queries?

1105


What is the difference between notify and notifyall method?

1220


Which is better singleton or static class?

987


Do I need java on my pc?

1052


What do you understand by the term string pool?

1011


Why volatile is used in java?

1071


How many bits is a string?

1005


What is update method called?

1159


How do you allocate memory to object?

1001