Download presentation
Presentation is loading. Please wait.
1
Unit-2 Objects and Classes
Visibility modifiers
2
Visibility Modifiers Example : Private Modifiers:
The modifiers private, protected, and publicare known as visibilityor accessibility modifiers because they specify how class and class members are accessed. There are four Visibility Modifiers in java. Example : Private Modifiers: Figure illustrates how a public, default, and private data field or method in class C1 can be accessed from a class C2 in the same package and from a class C3 in a different package.
3
Visibility Modifiers(Cont.)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.