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


Use of private variable while creating properties ???



Use of private variable while creating properties ???..

Answer / m4n07

I am newbie in J2EE & looking for strong basic behind each
concept as,
Why do we use private access specifier before each variable of
type property bcoz ultimately to access it outside the class
we use public method as getter & setter ?

If we use getter & setter to access it outside the class so
better we make variable as public so that it is easily
available outside of the class...

Please guide me why do we use as private ????

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More J2EE Interview Questions

Why is java important for internet?

0 Answers  


What is jaxr provider?

0 Answers  


How to call main class with in main class?

2 Answers   IBM, Infosys,


Diffrence between arraylist and hashmap

3 Answers   Oracle,


What is authorization constraint?

0 Answers  


to update a batch in a table in jdbc which method of statement object is used

1 Answers  


What is digest authentication?

0 Answers  


Every field has setter and getter methods.what is happening in this methods.

2 Answers  


What is container-managed transaction?

0 Answers  


What is java 2 platform, micro edition (j2me)?

0 Answers  


What is architecture neutral in java?

0 Answers  


Which of the following are subclasses of java awt component?

0 Answers  


Categories