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 |
How do you sort arrays in java?
Can a method be static?
How do you escape sequences in java?
Can a final variable be null?
suppose string s1="rajnish"; string s2="bhaskar"; then what will be happend ?
Explain parallel processing in java8?
Why java is made?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
how can you take care of mutual exclusion using java threads? : Java thread
How the elements are organized in BorderLayout?
Does treeset use compareto?
Can we add two byte variables and assign the result to a byte variable ? b=b1+b2 where b,b1,b2 are byte types