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 ????
Answer Posted / srinivaskumar.nimmana
Here data is very important, data means variable.. if our class variable are need access by several classes because of that classes code may corrupt our classes code because of our data directly available to that classes, so we need secure to our data that's why we declare as private variables
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is java ee used for?
How can I be good in java?
Is java gui dead?
What is a thin client?
What is jbutton in java?
Describe action form?
What is meant by applet in java?
Is java 100 percent pure object oriented?
On which platform j2ee is based?
Why java is oop language?
Is python more secure than java?
What every java developer should know?
What is java gui?
What are the j2ee technologies?
What is wildfly java?