Chapter 2. Object-Oriented Programming Concepts

IF you’ve never used an object-oriented programming language before, you’ll need to learn a few basic concepts before you can begin writing any code. This chapter will introduce you to objects, classes, inheritance, interfaces, and packages. Each discussion focuses on how these concepts relate to the real world while simultaneously providing an introducion to the syntax of the Java programming language.

What Is an Object?

Objects are key to understanding object-oriented technology. Look around right now and you’ll find many examples of real-world objects: your dog, your desk, your television set, your bicycle.

Real-world objects share two characteristics: They all have state and behavior. Dogs have ...

Get The Java™ Tutorial Fourth Edition: A Short Course on the Basics now with O’Reilly online learning.

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