© Vaskaran Sarcar 2020
Vaskaran SarcarInteractive Object-Oriented Programming in Javahttps://doi.org/10.1007/978-1-4842-5404-2_2

2. The Building Blocks: Class and Objects

Vaskaran Sarcar
Bangalore, Karnataka, India
Object-oriented programming (OOP) techniques primarily depend on two concepts—class and objects. In this chapter, we’ll discuss these topics in detail.


A class is a blueprint, template, or prototype. It can describe the behaviors of its objects and is the foundation for how the objects are built or instantiated.


An object is an instance of a class.
If you are familiar with the game of football (or soccer, as it’s known in the United States), you know the players who are participating in a game are selected for their skills ...

Get Interactive Object-Oriented Programming in Java: Learn and Test Your Programming Skills now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.