© Kishori Sharan and Adam L. Davis 2022
K. Sharan, A. L. DavisBeginning Java 17 Fundamentalshttps://doi.org/10.1007/978-1-4842-7307-4_7

7. Classes

Kishori Sharan1   and Adam L. Davis2
(1)
Montgomery, AL, USA
(2)
Oviedo, FL, USA
 
In this chapter, you will learn:
  • What classes are in Java

  • How to define classes in Java

  • How to declare class members such as fields

  • How to create objects of a class

  • How to declare import statements in a compilation unit

  • How to define a Record in Java

What Is a Class?

Classes are the basic units of programming in the object-oriented paradigm. In Chapter 3, you looked at some elementary aspects of a class in Java, for example, using the class keyword to declare a class, declaring the main() method to run a class, etc. This chapter explains ...

Get Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 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.