Chapter 5. Classes and Objects
Classes and objects form the basis of object-oriented programs. A class serves as an architectural blueprint—consisting of fields and methods—from which objects are created. Those objects model anything we want—from subatomic particles to employees to bank accounts to vehicles, to the entire universe. It's vital that you become familiar with classes and objects because you'll use those features in every object-oriented Java program that you write.
Classes
A class introduces a developer-defined type into a program, by way of code implementation. That implementation manifests itself through fields and methods. Use the following class declaration syntax to specify a class in source code:
[ 'public' ] [ ( 'abstract' | ...
Get Java™ 2 by Example, Second 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.