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
How do you convert an int to a double in java?
What is the difference between quicksort & mergesort? When should they be used? What is their running time?
Can we declare array without size in java?
Is node a data type in java?
What is the main purpose of java?
How do you include a string in java?
How to split arraylist elements in java?
how do I create a runnable with inheritance? : Java thread
what is a working thread? : Java thread
Define a java class.
What are advantages of using Java?s layout managers than windowing systems?
What is boolean false?
What is a flag value?
What is the difference between a local variable and an instance variable?
What is finally and finalize in java?