Chapter 7. Classes
If you are unfamiliar with object-oriented programming, you might find talk about classes and objects rather mysterious. In reality classes are not all that complicated to understand. A class is a named block of code that defines a reference type. The class is the basic building block of all Java programs. The class provides the structure or blueprint for objects. An object is an instance of a class.
Classes will, in general, consist of members (fields, methods, and nested classes and interfaces), initializers (both instance and static), and constructors. The fields define the data structure of the class. The methods will generally be used to access and manipulate the fields. Initializers and constructors are normally used to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access