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 Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is java multithreaded?

533


Is java type safe?

507


What is the meaning of 3 dots in java?

680


How do you bind variables?

523


what is meant by Garbage collection?

616






Can we write class inside a class in java?

548


What does you mean in math?

535


What is singleton class and how can we make a class singleton?

659


What is the difference in between cpp and java? Can u explain in detail?

603


What is a cup of java?

555


Describe different states of a thread.

575


What is an 8 bit word?

590


Is alive in java?

502


Is void a return type?

548


What is used of static keyword in java?

583