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 |
Can you explain the cs option of java interpreter?
suppose string s1="rajnish"; string s2="bhaskar"; then what will be happend ?
Can a set contain duplicates?
What are the 8 primitive data types in java?
What is a lock or purpose of locks in java?
Is null a string in java?
What are wrapper classes in java?
How many static init can you have?
When does the compiler supply a default constructor for a class?
What is byte code and why is it important to java’s use for internet programming?
Define packages in java?
What is meant by data hiding/encapsulation?