© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
J. FriesenLearn Java Fundamentalshttps://doi.org/10.1007/979-8-8688-0351-2_6

6. Classes and Objects

Jeff Friesen1  
(1)
Dauphin, MB, Canada
 

This chapter introduces you to classes and objects. It then focuses on ten additional topics that you need to know when working with these language features.

Introducing Classes

Classes are templates for creating your own user-defined types. You use classes to describe virtual entities such as an account or physical entities such as a vehicle.

In this section, you first learn how to declare classes. You then learn how to populate classes with fields, methods, and constructors.

Declaring Classes

You declare a class by specifying ...

Get Learn Java Fundamentals: A Primer for Java Development and Programming 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.