Chapter 25. Advanced Object Programming

An essential concept of object-oriented programming is the way it represents data. In an object-oriented language such as Java, an object represents two things:

  • Behavior—. The things an object can do.

  • Attributes—. The data that differentiates the object from other objects.

Combining behavior and attributes is a departure from many other programming languages. A program has typically been defined as a set of instructions that manipulate data. The data itself is a separate thing, as in the example of word-processing software. Most word processors are considered programs that are used to create and edit textual documents.

Object-oriented programming and other techniques are blurring the line between program and ...

Get Sams Teach Yourself Java™ 2 Platform in 21 Days Professional Reference Edition now with O’Reilly online learning.

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