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?



FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE ..

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

More Core Java Interview Questions

What is parameter example?

0 Answers  


what type of questions asked for barclays technologies pune please send urgent

0 Answers  


What is n in java?

0 Answers  


What is the symbol for average?

0 Answers  


What happens when a thrown exception is not handled?

0 Answers   Wipro,






There are 100 keys and values in HashMap.how to get the keys and values?

1 Answers   IBS,


How to override equals() and hashCode() method in java?

1 Answers   Wipro,


Do I need java on my computer?

0 Answers  


What is stack class in java?

0 Answers  


Why main method is static in java?

0 Answers  


When do you get classcastexception?

0 Answers  


what is meant by UP& DOWN casting in java?

6 Answers  


Categories