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

FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS
CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO
LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE
NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

Answer Posted / fraz

Lets say you have Employee class

public class Employee{
private String id;
private String name;
..getter/setters..

}

You just have to overide hascode() and equals() method in
above class.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the static block?

1122


Which is the best approach for creating thread ?

1278


What are advantages and disadvantages of OOPs?

1202


Explain about procedural programming language or structured programming language and its features?

1181


What is meant by polymorphism?

1087


Can we override constructors in java?

1218


How can constructor chaining be done using this keyword?

1342


What is the maximum size of list in java?

1021


Can we use different return types for methods when overridden?

1063


List some features of the abstract class.

1128


What are the advantages and disadvantages of reference counting in garbage collection?

1075


What is a buffer in computer?

1067


What is an 8 bit word?

1102


What is collection sort in java?

999


How does regex work?

1023