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 a condition in programming?
Explain about oops concepts.
What do you mean by synchronized non access modifier?
What data type is true or false?
What is the meaning of immutable regarding string?
What is connection class in java?
What is java virtual machine and how it is considered in context of java’s platform independent feature?
Write an algorithm for quick sort?
What is public static void main?
What is the finalize method do?
Explain the difference between private, public, package and protected in java?
Why are getters and setters used?
What is exception handling in java?
What is a null class?
What is linked hashmap and its features?