Modifiers

The techniques for programming you learn today involve different strategies and ways of thinking about how a class is organized. But the one thing all these techniques have in common is that they all use special modifier keywords in the Java language.

In Week 1, you learned how to define classes, methods, and variables in Java. Modifiers are keywords that you add to those definitions to change their meaning.

The Java language has a wide variety of modifiers, including

  • Modifiers for controlling access to a class, method, or variable: public, protected, and private

  • The static modifier, for creating class methods and variables

  • The final modifier, for finalizing the implementations of classes, methods, and variables

  • The abstract modifier, for ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.