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 difference between char array and string?
Which programming language is most secure?
Does isempty check for null?
What is a stack class in java ?
what is use of functional interface in java 8?
What is java regex?
Why set is used in java?
Can you use this() and super() both in a constructor?
How do you sort arraylist in descending order?
What are the benefits of java?
What is garbage collection? What is the process that is responsible for doing that in java?
Difference between string s= new string (); and string s = "abv";?
What are the different access modifiers available in java?
What is fail fast in java?
Can array grow dynamically in java?