Access, Encapsulation, and Static Methods
Let's dive deeper into classes and learn about some of their more advanced features.
StartKey Concepts
Review core concepts you need to learn to master this subject
The public and private keywords
Encapsulation
The private Keyword
Accessor Methods
Mutator Methods
Local Variables
The this Keyword with Variables
The this Keyword with Methods
The public and private keywords
The public and private keywords
In Java, the keywords public
and private
define the access of classes, instance variables, constructors, and methods.
private
restricts access to only the class that declared the structure, while public
allows for access from any class.
Access, Encapsulation, and Scope
Lesson 1 of 2
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory