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 main string [] args?

935


Can we create object of static class?

967


How do generics work?

888


How do you get length in java?

967


Why do we use threads in java?

1043


What is consumer interface?

943


What is a website container?

896


How to obtain a performance profile of java program

951


What are different types of states exist for a thread?

959


Can a class be declared as static?

1107


What are scriptlets?

1025


What is a ?

1152


What are predefined functions?

1055


How many types of parsers are there?

959


What is meant by bytecode?

963