Home Segments Top Top Previous Next

7: Mainline

Because Java is object oriented, programs consist of class definitions.

In Java, some class definitions establish the characteristics of generic program elements, such as vectors. Other class definitions—the ones that you define yourself—establish the characteristics of application-specific categories, such as railroad cars, stocks, foods, movies, or whatever else happens to come up naturally in your application. Once a class is defined, you can create class instances that describe the particular properties of the individuals that belong to it.

When you design a program around classes and class instances, you are said to practice object-oriented programming. In contrast, when you design programs around procedures, you are said to practice procedure-oriented programming.