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...

What is the use of Getters and Setters method ?

Answer Posted / sumit bansal

you can put verification code in setter as if you want a
variable for storing weight you never want weight -ve So
write the code that prevent -ve entry of varible value in
setter method

Using getter and making your variable private you can be
sure that nobody can access it directly from outside.

Is This Answer Correct ?    31 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What string is utf8?

1046


What is a constructor overloading in java?

1106


Can a class be defined inside an interface?

1084


what is daemon thread and which method is used to create the daemon thread? : Java thread

1033


What is a return in java?

1075


Explain importance of finally block in java?

1089


What is the synchronized method modifier?

1280


What is use of map in java?

1062


What is string pool?

1216


Define jit compiler?

1211


What is the static import?

1156


How do you create a reference in java?

1027


What does the “static” keyword mean?

1172


What are the steps involved to create a bean?

1216


Explain about map interface in java?

1052