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 are sets in java?
What is jvm? Why is java called the platform independent programming language?
What are java packages?
Is java map thread safe?
What is a package in java? List down various advantages of packages.
How can you make a class serializable in java?
What is java command?
What if static is removed from main method?
How many ways can we create the string object?
Can we have try block without catch block?
Explain 5 features introduced in jdk 1.7?
Does list allow duplicates in java?
What is a boolean expression in java?
What is difference between ++ I and I ++ in java?
make a method which any number and any type of argument and print sum of that arguments.....