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 do you understand by java?
What will happen if static modifier is removed from the signature of the main method?
How do you find the independent variable?
Which sorting algorithm is best in java?
Can a source file contain more than one class declaration?
Is char a data type in java?
When do we use synchronized blocks and advantages of using synchronized blocks?
Is there any limitation of using inheritance?
How do you decide when to use arraylist and linkedlist?
How to sort double array in java?
Name component subclasses that support painting in java programming?
What is one third plus one third as a fraction?
Can you explain the usages of class.forname()?
What is a default method?
What is java dot?