I have one POJO class(Java bean class), it has two
variables for that it has setters and getters. Now i have
created two objects for that class and i have set the data
for those variables through this two objects. Now question
is i want check whether those two objects have same data or
not, for this write a program? Thanks, Bose.
Answer Posted / murli
override equals method from object class and have the comparison logic inside that.Also override hashcode method..
Now pBeanOne.equals(pBeanTwo) will give you the result
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is the difference between an argument and a parameter?
What is t in parametric equations?
What are synchronized methods and synchronized statements in java programming?
What is a jit compiler?
What is meant by final class?
what is ststic with example
Name four container classes.
What is unicode with example?
What is final access modifier in java?
What is a newline character in java?
What is a method declaration?
What is a instance variable?
Is string is a class in java?
Why do we need data structure in java?