2.1 Three starter programs
2.2 The structure of a program
2.3 Basics of object orientation
2.4 Beginning with output
2.5 Simple calculations
In this chapter we give a broad overview of the different parts of a Java program and how they fit together. Using three carefully chosen examples, we are able to explain the concepts of object-oriented programming so that, by the end, we shall be able to create and run simple programs that have tangible results. The programs are written in the best Java style, and form the pattern for solutions to follow.
To start this chapter we shall look at three small programs ...