O'Reilly logo

Java™ for Programmers: Deitel by Harvey M. Deitel - Deitel & Associates, Inc., Paul J. 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

3. Introduction to Classes and Objects

Objectives

In this chapter you’ll learn:

• What classes, objects, methods and instance variables are.

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

• How to declare methods in a class to implement the class’s behaviors.

• How to declare instance variables in a class to implement the class’s attributes.

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

• The differences between instance variables of a class and local variables of a method.

• How to use a constructor to ensure that an object’s data is initialized when the object is created.

• The differences between primitive and reference types.

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

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