Programming and Problem Solving with Java

(やまだぃちぅ) #1

(^20) | Introduction to Object-Oriented Programming
(^5) The memory unit is also referred to as RAM, an acronym for random access memory (because we can
access any location at random).
tial concepts of programming.
In the next few chapters, we consider how to write simple code that instantiates just a few
of the classes in Java’s library. We first learn how to write a specific form of class, called an ap-
plication.Then we write some simple classes of our own. Once we gain some experience with
these essentials, in Chapter 6 we see how to organize a solution to a complex problem in a man-
ner that takes full advantage of the features of classes and objects. In Chapter 7, we explore
the aspects of the Java language that enable us to extend existing classes with new features.


1.6 What’s Inside the Computer?


You can learn how to use a programming language, write applications, and run (execute) these
applications without knowing much about computers. If you know something about the
parts of a computer, however, you can better understand the effect of each instruction in a
programming language.
Most computers have six basic components: the memory unit, the arithmetic/logic unit,
the control unit, input devices, output devices, and auxiliary storage devices. Figure 1.10
shows a stylized diagram of the basic components of a computer.
The memory unitis an ordered sequence of storage cells, each capable of hold-
ing a piece of data. Each memory cell has a distinct address to which we refer to
store data into it or retrieve data from it. These storage cells are called memory
cells, or memory locations.^5 The memory unit holds data (input data or the product
of computation) and instructions (programs), as shown in Figure 1.11.

Figure 1.10 Basic Components of a Computer

Input
device

Output
device

Auxiliary
storage
device

Memory unit

Arithmetic/logic unit

Control unit

Central processing unit

Memory unit Internal data
storage in a computer

T


E


A


M


F


L


Y


Team-Fly®

Free download pdf