3. Introduction to Classes, Objects, Methods and Strings

Your public servants serve you right.

—Adlai E. Stevenson

Nothing can have value without being an object of utility.

—Karl Marx

Objectives

In this chapter you’ll learn:

Image How to declare a class and use it to create an object.

Image How to implement a class’s behaviors as methods.

Image How to implement a class’s attributes as instance variables.

How to call an object’s methods to make them perform their ...

Get Java™ How To Program (Early Objects), Tenth 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.