1.5. Nonaccess modifiers
[7.5] Use abstract classes and interfaces
[6.2] Apply the static keyword to methods and fields
This section discusses the nonaccess modifiers abstract, final, and static. Access modifiers control the accessibility of your class and its members outside the class and the package. Nonaccess modifiers change the default behavior of a Java class and its members.
For example, if you add the keyword abstract to the definition of a class, it can’t be instantiated. Such is the magic of the nonaccess modifiers.
You can characterize your classes, interfaces, methods, and variables with the following nonaccess modifiers (though not all are applicable to each Java entity):
- abstract
- static ...
Get OCA Java SE 8 Programmer I Certification Guide 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.