Declaring a Class

In general, Java class declarations take the form

						AccessSpecifier Modifiers class NewClass extends SuperclassName
  implements InterfaceName
					

where everything in italics is optional. As you can see, there are five properties of the class that can be defined in the declaration:

  • Access Specifier

  • Modifiers

  • Class name

  • Superclass

  • Interfaces implemented

See Chapter 9, "Interfaces,"

Access Specifiers

The access specifier in a class declaration determines how visible a class is to other classes. The specifiers that apply to classes are similar to the method access specifiers discussed in Chapter 4, "Methods and Exceptions." Although specifiers are not of primary importance while developing an individual class, they become very important ...

Get Special Edition Using Java 2 Standard 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.