Other Modifiers

Java supports several other modifiers besides the access modifiers. These modifiers are covered in the following subsections.

NOTE

abstract and final Neither abstract classes nor abstract methods can be declared as final.

abstract

The abstract modifier is used to identify abstract classes and methods. An abstract class defers its implementation to its subclasses and cannot be instantiated. Abstract classes provide a way to enforce a class design and hierarchy without requiring a particular implementation.

NOTE

abstract Subclasses If a class extends an abstract class, then it must implement all methods declared as abstract, if any, or be declared as abstract.

Abstract classes can declare abstract methods. An abstract method is ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.