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 digest authentication?
How java is reliable?
What is urn?
What is a web container j2ee?
What is jaxr client?
What is the mvc on struts?
What type of code is java?
What is caller?
Is downloading java safe?
What is java api for xml registries (jaxr)?
Where is java used?
What is java ee sdk?
Why is java called object oriented?
Define thin client?
Define the struts in the j2ee framework?