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
Can a list be null in java?
Why is java not 100% pure oops?
What are the two ways to create a thread?
What is jit compiler ?
Difference between static synchronization vs. Instance synchronization?
What is the tradeoff between using an unordered array versus an ordered array?
Can java list contain duplicates?
Is java a compiler?
What is the difference between keyword and identifier?
What is difference between this and super keyword?
What are the different tags provided in jstl?
What is constant in programming?
How does the java compiler work?
What is bifunction in java?
Write a java program that prints all the values given at command-line.