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 main string [] args?
Can we create object of static class?
How do generics work?
How do you get length in java?
Why do we use threads in java?
What is consumer interface?
What is a website container?
How to obtain a performance profile of java program
What are different types of states exist for a thread?
Can a class be declared as static?
What are scriptlets?
What is a ?
What are predefined functions?
How many types of parsers are there?
What is meant by bytecode?