Class: Class declaration

Class declaration

  1. Modifiers such as public, private, and a number of others.
  2. The class name, with the initial letter capitalized by convention.
  3. The name of the class's parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
  4. A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.
  5. The class body, surrounded by braces, {}.
Class MyClass extends MySuperClass implements YourInterface {
    // field, constructor, and
    // method declarations
}

Related concepts

Class: Class declaration — Structure map

Clickable & Draggable!

Class: Class declaration — Related pages: