Section 1.1 Introduction
This chapter introduces some of the basic concepts and techniques involved in Java program design and development.
We begin by identifying the main steps in designing an object-oriented program. The steps are illustrated by designing a program that “asks” and “answers” riddles. For example,
Riddle: What is black and white and red all over?
Answer: An embarrassed zebra.
Following the design phase, we then focus on the steps involved in coding a Java program, including the process of editing, compiling, and running a program. Because Java programs can be text based applications or window based graphical applications, we describe how the coding process differs for these two varieties.
Next we begin to familiarize ourselves with Java’s extensive class library by studying its
PrintStream
and System
classes. These classes contain objects and methods that enable us to print output from a program. By the end of the chapter you will be able to design and write a Java application that “sings” your favorite song.You have attempted of activities on this page.