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 / 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 |
What is string builder?
What is immutability in java?
What are the differences between wait() and sleep()?
What are the topics in advance java?
How many bytes is double?
Explain the purpose of garbage collection in Java?
Can you override a final method?
What is the purpose of skeleton and stub?
what is the Diff. between Access Specifiers and Access Modifiers?
39 Answers BMC, Cyber Shot, Infosys, VTS, Wipro,
What does the “static” keyword mean?
In a container there are 5 components. I want to display all the component names, how will you do that?
How do weakhashmap works?