
Introduction
Writing computer programs that use classes and objects is called object-
oriented programming, or OOP. Every Java program consists of at least
one class.
In this chapter, we’ll introduce object-oriented programming as a way to
use classes that have already been written. Classes provide services to the
program. These services might include writing a message to the program’s
user, popping up a dialog box, performing some mathematical calcula-
tions, formatting numbers, drawing shapes in a window, or many other
basic tasks that add a more professional look to even simple programs. The
program that uses a class is called the client of the class. ...