Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between double and float variables in java?

1196


If try block is successfully executed, Then Is Finally block executed?

1121


What are design patterns and please explain?

1132


Why javac is not recognized?

1000


What do you mean by local variable and instance variable?

994


What is regex in java?

990


Why do we use threads in java?

1169


What is the java idl system?

1082


What is ++ a in java?

1030


What is the finalize method do?

1148


What is files manifesting?

2253


What are the main concepts of oops in java?

1850


Explain the importance of finalize() method.

1019


I want to re-reach and use an object once it has been garbage collected. How it's possible?

1073


What is bool mean?

1138