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
What is the difference between double and float variables in java?
If try block is successfully executed, Then Is Finally block executed?
What are design patterns and please explain?
Why javac is not recognized?
What do you mean by local variable and instance variable?
What is regex in java?
Why do we use threads in java?
What is the java idl system?
What is ++ a in java?
What is the finalize method do?
What is files manifesting?
What are the main concepts of oops in java?
Explain the importance of finalize() method.
I want to re-reach and use an object once it has been garbage collected. How it's possible?
What is bool mean?