O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.2. Defining Classes

A class declaration introduces a new reference type. It has the following general syntax:

<class modifiers> class <class name>               <extends clause> <implements clause>  // Class header{ // Class body     <field declarations>     <method declarations>     <nested class declarations>     <nested interface declarations>     <constructor declarations>     <initializer blocks>}

In the class header, the name of the class is preceded by the keyword class. In addition, the class header can specify the following information:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required