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 token in java?
Explain about automatic type conversion in java?
Can we declare the static variables and methods in an abstract class?
What is thread count in java?
what do you understand by synchronization? : Java thread
What does regex mean?
Explain the importance of finalize() method.
Explain the difference between hashmap and hashtable in java?
What is sizeof in java?
What is the major drawback of internal iteration over external iteration?
Is there a way to increase the size of an array after its declaration?
How do you sort data in java?
What are the principle concepts of oops?
Can abstract class have private constructor?
What are byte codes?