O'Reilly logo

Sams Teach Yourself Java™ 2 Platform in 21 Days Professional Reference Edition by Rogers Cadenhead, Laura Lemay

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 6. Creating Classes

If you're coming to Java from another programming language, you might be going through a class struggle. The term “class” seems synonymous to the term “program,” but you could be uncertain of the relationship between the two.

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

Today you go to the head of the class in terms of what you know on the subject. You create classes and read about each of the following:

  • The parts of a class definition

  • The creation and use of instance variables

  • The creation and use of methods

  • The main() method used in Java ...

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