Chapter 2. Introducing Objects

  • Downloading and Compiling Java

  • What Is a Class?

  • What Is an Object?

  • Java Digital Clock Program

  • Summary

  • Exercises

  • Some Light Relief—Napster and LimeWire

Here's where we get to grips with a real Java program. Follow the steps in Appendix A to download a Java compiler. Then you can type in source code and test examples as we go along.

The chapter presents some basics of Object Oriented Programming (OOP). We'll explain exactly what language designers mean by a type, and relate that to the objects in OOP. We'll develop a type called Timestamp, then add a couple of other types to turn it into a complete program. Along the way, we'll clarify the super-important distinction between “an object” and “a reference ...

Get Just Java™ 2 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.