Key Concepts

Review core concepts you need to learn to master this subject

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

Pro Logo