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 static block?
Which is the best approach for creating thread ?
What are advantages and disadvantages of OOPs?
Explain about procedural programming language or structured programming language and its features?
What is meant by polymorphism?
Can we override constructors in java?
How can constructor chaining be done using this keyword?
What is the maximum size of list in java?
Can we use different return types for methods when overridden?
List some features of the abstract class.
What are the advantages and disadvantages of reference counting in garbage collection?
What is a buffer in computer?
What is an 8 bit word?
What is collection sort in java?
How does regex work?