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 |
Why we can not force Garbage Collection?
Is there memory leaks in java?
What class of exceptions are generated by the java run-time system?
What is the intersection and union methods?
What is the difference between getCodeBase and getDocumentBase methods?
1 Answers CS Business Services,
Why can't you declare a class as protected?
What are the rules for variable declaration?
what is overloading in java?
13 Answers Ascent, DNS, Infosys, SDA, VelTech,
how to handle http request in struts
what is java bean?where can we use it?
How many wrapper classes are there in java?
What are keywords and reserved words in java?