Chapter 2. Simple programs

Simple programs

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.

Three starter programs

To start this chapter we shall look at three small programs ...

Get Java Gently, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.