Module #1 - Introduction To OOP
Module #1 - Introduction To OOP
Module #1 - Introduction To OOP
example: A person
Private
Protected
Package
Data Access Levels
• Classes, and their fields and methods
have access levels to specify how they
can be used by other objects during
execution, while cooperation among
objects is desirable, there are times
when you will want to explicitly control
access, and specifying access levels is
the way to gain that control.
Data Access Levels
• Fields and methods can be declared
private, protected, public, or package.