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...

If set accepts only one argument then how can it compare
two objects to avoid duplicates

Answer Posted / ashutosh

for comparison between two objects of the same class, class
must override equals() and hashcode() methods of the object
class.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I right-justify a string?

1110


Is singleton a bad practice?

995


What is default locale java?

1054


Can we override constructors in java?

1079


What is t in generics in java?

1014


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

2289


When is the garbage collection used in Java?

1137


Is treeset sorted in java?

937


What is a prefix function.write down a code to compute prefix function.

1012


What is functional interface in javatpoint?

983


How we create object in copy constructor?

1077


Why destructor is not used in java?

935


What is the relationship between clipping and repainting under awt?

1102


Can long be null in java?

961


What is off heap memory?

941