Title: Key Concept - Access Modifiers
Course: CPS 189: Java Certification - Review, Practice & Prepare (Development) > Section: Learning Modules

Access modifiers control how a class, field, or method may be accessed outside the class.

Access modifiers include:

- public – the member is accessible from all other classes.
- private – the member is accessible only within the class

A class must be declared public, abstract, or final.

- Generally, fields are declared private while methods are declared public.  Declaring a field or method private carries out encapsulation.