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 |
What is an object in java and how is it created?
How many bytes is a string?
how to convert mm/dd/yy to dd/mm/yy using collections in java.
can u handle an error if u write Thowable in the catch class lise try { some errorneous code }catch(Throwable e){ ...}
Can we convert integer to string in java?
Hi can u pls tell me what is the use of marker interface. Iknow what is marker interface but what ability will the object get by implementing this.
What are the various access specifiers for java classes?
What is a copy constructor in java?
how do you store phone numbers using java collections
Why do we need hashset in java?
What is the size of a string in java?
Is there a sort function in java?