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 is difference between path and classpath variables?

1150


What is args length in java?

1234


What ide should I use for java?

1087


What is the static variable?

1174


What is unicode used for?

1237


Which one of the following suits the description of a string better: derived or primitive?

1008


What are basic data types?

1163


What is a class variable?

1095


How big is a 64 bit float?

1067


Can we serialize arraylist in java?

1059


How to create com object in Java?

1115


Why java is considered as platform independent?

1054


What is stored procedure. How do you create stored procedure ?

1983


What are the differences between this and super keyword?

983


What is thread safe java?

971