Chapter 10. Creating Your First Object

<feature><title></title>

WHAT YOU’LL LEARN IN THIS HOUR:

  • Creating an object

  • Describing an object with attributes

  • Determining how objects behave

  • Combining objects

  • Inheriting from other objects

  • Converting objects and other types of information

</feature>

One of the more fearsome examples of jargon that you encounter during these 24 hours is object-oriented programming (OOP). This complicated term describes, in an elegant way, what a computer program is and how it works.

Before OOP, a computer program was usually described under the simplest definition you’ve learned in this book: a set of instructions listed in a file and handled in some kind of reliable order.

By thinking of a program as a collection of objects, you ...

Get Sams Teach Yourself Java™ in 24 Hours, Fifth Edition 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.