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
What is the lifetime and scope of a variable?
What is the default value of an object reference declared as an instance variable?
What is the finalize method do?
What does exp mean in math?
What are the types of methodology?
What is append function?
Explain about fail fast iterators in java?
What are unchecked exceptions in java?
Can inner class be public in java?
How to declare an arraylist in java?
What is the difference between multitasking and multithreading in Java
What does \ mean in regex?
Can singleton class be serialized?
What are 3 data types?
Why collection is called framework in java?