Java Reference
In-Depth Information
Chapter 1 Introduction
C HAPTER G OALS
ȗ
To understand the activity of programming
ȗ
To learn about the architecture of computers
ȗ
To learn about machine code and high-level programming languages
ȗ
To become familiar with your computing environment and your compiler
ȗ
To compile and run your first Java program
ȗ
To recognize syntax and logic errors
The purpose of this chapter is to familiarize you with the concept of programming. It
reviews the architecture of a computer and discusses the difference between machine
code and high-level programming languages. Finally, you will see how to compile
and run your first Java program, and how to diagnose errors that may occur when a
program is compiled or executed.
2
1.1 What Is Programming?
You have probably used a computer for work or fun. Many people use computers for
everyday tasks such as balancing a checkbook or writing a term paper. Computers are
good for such tasks. They can handle repetitive chores, such as totaling up numbers or
placing words on a page, without getting bored or exhausted. Computers also make
good game machines because they can play sequences of sounds and pictures,
involving the human user in the process.
The flexibility of a computer is quite an amazing phenomenon. The same machine can
balance your checkbook, print your term paper, and play a game. In contrast, other
machines carry out a much narrower range of tasksȌa car drives and a toaster toasts.
To achieve this flexibility, the computer must be programmed to perform each task. A
computer itself is a machine that stores data (numbers, words, pictures), interacts with
devices (the monitor screen, the sound system, the printer), and executes programs.
Search WWH ::




Custom Search