O'Reilly logo

Sams Teach Yourself Java in 21 Days, Sixth Edition by Rogers Cadenhead

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

Day 5. Creating Classes and Methods

If you’re coming to Java from another programming language, you might be struggling with the meaning of the term class. It seems synonymous with the term program, but you might be uncertain of the relationship between the two.

In Java, a program is made up of a main class and any other classes needed to support the main class. These support classes include any you might need in the Java class library, such as String, Math, and the like.

Today, the meaning of class is clarified as you create classes and methods, which define the behavior of an object or class. You learn about each of the following:

• The definition of the parts of a class

• The creation and use of instance variables

• The creation and use of ...

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