© Ron Dai 2019
R. DaiLearn Java with Mathhttps://doi.org/10.1007/978-1-4842-5209-3_24

24. Classes in Object-Oriented Programming

Ron Dai1 
(1)
Seattle, WA, USA
 

An object is essentially a representation of a thing. An object has some attributes, just like everything has characteristics. However, a class in the programming world is primarily a data structure designed for a specific object. The class is also said to be a blueprint of an object. It keeps track of a bundle of related things about the object. These related things are known as fields, properties, and functions (or methods).

The fields are data members of a class. They must be declared and initialized before they are used. They are mostly for class internal use.

Some fields may serve as properties, ...

Get Learn Java with Math: Using Fun Projects and Games 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.