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

How do you convert an int to a double in java?

1019


What is the difference between quicksort & mergesort? When should they be used? What is their running time?

1041


Can we declare array without size in java?

973


Is node a data type in java?

956


What is the main purpose of java?

1039


How do you include a string in java?

937


How to split arraylist elements in java?

1112


how do I create a runnable with inheritance? : Java thread

949


what is a working thread? : Java thread

1002


Define a java class.

1359


What are advantages of using Java?s layout managers than windowing systems?

2326


What is boolean false?

934


What is a flag value?

965


What is the difference between a local variable and an instance variable?

1039


What is finally and finalize in java?

1029