Advertisements
Advertisements
Question
Name the access specifiers provided by Java.
Short Answer
Advertisements
Solution
- default: Visible to the package and to the objects
- private: Visible to the class only and not to the objects
- public: Visible to the world and to the objects
- protected: Visible to the package and all to subclasses and the objects
shaalaa.com
Is there an error in this question or solution?
Chapter 6: Encapsulation - Exercises [Page 148]
