concept class declaration in category java

appears as: class declaration, class declarations, The class declaration
Java SE 11 Programmer I Certification Guide MEAP V03

This is an excerpt from Manning's book Java SE 11 Programmer I Certification Guide MEAP V03.

The package statement can’t appear within a class declaration or after the class declaration. The following code will fail to compile:

Figure 3.4 Components of a class declaration
Table 3.1 summarizes the compulsory and optional components.

Table 3.1 Components of a class declaration

Mandatory

Optional

Keyword class

Access modifier, such as public

Name of the class

Nonaccess modifier, such as final

Class body, marked by the opening and closing curly braces, {}

Keyword extends together with the name of the base class

 

Keyword implements together with the names of the interfaces being implemented

  • Class declarations and class definitions are components of a Java class.
  • OCA Java SE 8 Programmer I Certification Guide

    This is an excerpt from Manning's book OCA Java SE 8 Programmer I Certification Guide.

  • Comments can contain any special characters (including characters from the Unicode charset).
  • The package statement can’t appear within a class declaration or after the class declaration. The following code will fail to compile:

    The components of the preceding class declaration can be illustrated as shown in figure 1.5.

    Figure 1.5. Components of a class declaration

    Table 1.1 summarizes the compulsory and optional components.

    sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest