O'Reilly logo

Java™ for Programmers: Deitel Developer Series, Second Edition by Harvey Deitel - Deitel & Associates, Inc., Paul Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Introduction to Classes, Objects, Methods and Strings

Nothing can have value without being an object of utility.

Karl Marx

Your public servants serve you right.

Adlai E. Stevenson

You’ll see something new. Two things. And I call them Thing One and Thing Two.

Dr. Theodor Seuss Geisel

Objectives

In this chapter you’ll learn:

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

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

• How to implement a class’s attributes as instance variables and properties.

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

• What instance variables of a class and local variables of a method are.

• How to use a constructor to initialize an object’s data.

• The differences ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required