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 |
whats string ?
What type of variable is error flag?
What is a double?
Are strings immutable in java?
What is the difference between static binding and dynamic binding?
What are the types of classes in java?
can we access the method of class without creating the object of the class
What are multiple inheritances? Is it supported by java?
Is alive and join method in java?
Is string is a keyword in java?
Why is java not 100% pure oops?
what is the collable collections in java?