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 token in java?

1019


Explain about automatic type conversion in java?

1049


Can we declare the static variables and methods in an abstract class?

990


What is thread count in java?

1008


what do you understand by synchronization? : Java thread

990


What does regex mean?

1013


Explain the importance of finalize() method.

968


Explain the difference between hashmap and hashtable in java?

943


What is sizeof in java?

1107


What is the major drawback of internal iteration over external iteration?

1029


Is there a way to increase the size of an array after its declaration?

1051


How do you sort data in java?

953


What are the principle concepts of oops?

960


Can abstract class have private constructor?

943


What are byte codes?

1221