100% found this document useful (11 votes)
111 views

Instant download A comprehensive introduction to object oriented programming with Java 1st Edition C. Thomas Wu pdf all chapter

Wu

Uploaded by

guaposjolene
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (11 votes)
111 views

Instant download A comprehensive introduction to object oriented programming with Java 1st Edition C. Thomas Wu pdf all chapter

Wu

Uploaded by

guaposjolene
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Get ebook downloads in full at ebookname.

com

A comprehensive introduction to object oriented


programming with Java 1st Edition C. Thomas Wu

https://ebookname.com/product/a-comprehensive-introduction-
to-object-oriented-programming-with-java-1st-edition-c-
thomas-wu/

OR CLICK BUTTON

DOWNLOAD EBOOK

Explore and download more ebook at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Object Oriented Programming With C 4th Edition E.


Balagurusamy

https://ebookname.com/product/object-oriented-programming-
with-c-4th-edition-e-balagurusamy/

Microsoft Visual C 2010 An Introduction to Object


Oriented Programming 4th Edition Joyce Farrell

https://ebookname.com/product/microsoft-visual-c-2010-an-
introduction-to-object-oriented-programming-4th-edition-joyce-
farrell/

Introduction to Object Oriented Programming An 3rd


Edition Timothy Budd

https://ebookname.com/product/introduction-to-object-oriented-
programming-an-3rd-edition-timothy-budd/

Software Testing with Visual Studio 2010 Microsoft NET


Development Series 1st Edition Jeff Levinson

https://ebookname.com/product/software-testing-with-visual-
studio-2010-microsoft-net-development-series-1st-edition-jeff-
levinson/
Learn Go with Pocket Sized Projects 1st Edition Aliénor
Latour

https://ebookname.com/product/learn-go-with-pocket-sized-
projects-1st-edition-alienor-latour/

Basic and advanced regulatory control system design and


application 2nd ed Edition Harold L. Wade

https://ebookname.com/product/basic-and-advanced-regulatory-
control-system-design-and-application-2nd-ed-edition-harold-l-
wade/

Finite size effects in correlated electron models exact


results Andrei A. Zvyagin

https://ebookname.com/product/finite-size-effects-in-correlated-
electron-models-exact-results-andrei-a-zvyagin/

Heroes of the Bible 111th Edition Jesse Thompson

https://ebookname.com/product/heroes-of-the-bible-111th-edition-
jesse-thompson/

A Pictorial Record of the Qing Dynasty Old Manchu


Capital 1st Edition Liaoning Provincial Library

https://ebookname.com/product/a-pictorial-record-of-the-qing-
dynasty-old-manchu-capital-1st-edition-liaoning-provincial-
library/
We ll Always Have the Movies American Cinema during
World War II First Edition Mclaughlin

https://ebookname.com/product/we-ll-always-have-the-movies-
american-cinema-during-world-war-ii-first-edition-mclaughlin/
wu23399_fm.qxd 1/10/07 11:53 Page i

A Comprehensive Introduction
to Object-Oriented Programming
TM
with Java

C.Thomas Wu
Naval Postgraduate School
wu23399_fm.qxd 1/10/07 11:53 Page ii

A COMPREHENSIVE INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING WITH JAVA

Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of the Americas,
New York, NY 10020. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. No part of this
publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system,
without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network
or other electronic storage or transmission, or broadcast for distance learning.

Some ancillaries, including electronic and print components, may not be available to customers outside
the United States.

This book is printed on acid-free paper.

1 2 3 4 5 6 7 8 9 0 DOC/DOC 0 9 8 7

ISBN 978–0–07–352339–2
MHID 0–07–352339–9

Publisher: Alan R. Apt


Executive Marketing Manager: Michael Weitz
Senior Project Manager: Sheila M. Frank
Lead Production Supervisor: Sandy Ludovissy
Associate Media Producer: Christina Nelson
Designer: Rick D. Noel
Cover Designer: Elise Lansdon
(USE) Cover Image: breaking wave on foaming ocean surface, ®Ron Dahlquist/Getty Images
Compositor: ICC Macmillan Inc.
Typeface: 10.5/12 Times Roman
Printer: R. R. Donnelley Crawfordsville, IN

Library of Congress Cataloging-in-Publication Data

Wu, C. Thomas.
A comprehensive introduction to object-oriented programming with Java / C. Thomas
Wu. – 1st ed.
p. cm.
ISBN 978–0–07–352339–2 — ISBN 0–07–352339–9
1. Object-oriented programming (Computer science) 2. Java (Computer program
language) I. Title.

QA76.64.W77 2008
005.117–dc22

2006048064

www.mhhe.com
wu23399_fm.qxd 1/10/07 11:53 Page iii

To my family
wu23399_fm.qxd 1/10/07 11:53 Page iv
wu23399_fm.qxd 1/10/07 11:53 Page v

Contents

Preface xiii
Key Differences from the Standard Edition xiii
Book Organization xiv
Hallmark Features of the Text xviii

0 Introduction to Computers and


Programming Languages 1
0.1 A History of Computers 2
0.2 Computer Architecture 4
0.3 Programming Languages 11
0.4 Java 12

1 Introduction to Object-Oriented Programming and


Software Development 15

1.1 Classes and Objects 16


1.2 Messages and Methods 18
1.3 Class and Instance Data Values 20
1.4 Inheritance 23
1.5 Software Engineering and Software
Life Cycle 24

v
wu23399_fm.qxd 1/10/07 11:53 Page vi

vi Contents

2 Getting Started with Java 29

2.1 The First Java Program 30


2.2 Program Components 39
2.3 Edit-Compile-Run Cycle 49
2.4 Sample Java Standard Classes 52
2.5 Sample Development 67

3 Numerical Data 81

3.1 Variables 82
3.2 Arithmetic Expressions 90
3.3 Constants 95
3.4 Displaying Numerical Values 97
3.5 Getting Numerical Input 103
3.6 The Math Class 109
3.7 Random Number Generation 113
3.8 The GregorianCalendar Class 115
3.9 Sample Development 120
3.10 Numerical Representation (Optional) 131

4 Defining Your Own Classes—Part 1 145

4.1 First Example: Defining and Using a Class 146


4.2 Second Example: Defining and Using Multiple Classes 156
4.3 Matching Arguments and Parameters 160
4.4 Passing Objects to a Method 162
4.5 Constructors 167
4.6 Information Hiding and Visibility Modifiers 172
4.7 Class Constants 175
4.8 Local Variables 183
4.9 Calling Methods of the Same Class 185
4.10 Changing Any Class to a Main Class 189
4.11 Sample Development 190
wu23399_fm.qxd 1/10/07 11:53 Page vii

Contents vii

5 Selection Statements 213

5.1 The if Statement 214


5.2 Nested if Statements 225
5.3 Boolean Expressions and Variables 231
5.4 Comparing Objects 239
5.5 The switch Statement 244
5.6 Drawing Graphics 248
5.7 Enumerated Constants 258
5.8 Sample Development 264

6 Repetition Statements 295

6.1 The while Statement 296


6.2 Pitfalls in Writing Repetition Statements 305
6.3 The do–while Statement 311
6.4 Loop-and-a-Half Repetition Control 315
6.5 The for Statement 319
6.6 Nested for Statements 324
6.7 Formatting Output 326
6.8 Loan Tables 331
6.9 Estimating the Execution Time 334
6.10 Recursive Methods (Optional) 338
6.11 Sample Development 343

7 Defining Your Own Classes—Part 2 365

7.1 Returning an Object from a Method 366


7.2 The Reserved Word this 370
7.3 Overloaded Methods and Constructors 378
7.4 Class Variables and Methods 383
wu23399_fm.qxd 1/10/07 11:53 Page viii

viii Contents

7.5 Call-by-Value Parameter Passing 387


7.6 Organizing Classes into a Package 394
7.7 Using Javadoc Comments for Class Documentation 395
7.8 The Complete Fraction Class 400
7.9 Sample Development 410

8 Exceptions and Assertions 437

8.1 Catching Exceptions 438


8.2 Throwing Exceptions and Multiple catch Blocks 445
8.3 Propagating Exceptions 450
8.4 Types of Exceptions 458
8.5 Programmer-Defined Exceptions 461
8.6 Assertions 463
8.7 Sample Development 469

9 Characters and Strings 487

9.1 Characters 488


9.2 Strings 491
9.3 Pattern Matching and Regular Expression 502
9.4 The Pattern and Matcher Classes 509
9.5 Comparing Strings 513
9.6 StringBuffer and StringBuilder 515
9.7 Sample Development 521

10 Arrays and Collections 543

10.1 Array Basics 544


10.2 Arrays of Objects 555
10.3 The For-Each Loop 565
wu23399_fm.qxd 1/12/07 13:15 Page ix

Contents ix

10.4 Passing Arrays to Methods 569


10.5 Two-Dimensional Arrays 576
10.6 Lists and Maps 583
10.7 Sample Development 596

11 Sorting and Searching 619

11.1 Searching 620


11.2 Sorting 624
11.3 Heapsort 632
11.4 Sample Development 645

12 File Input and Output 669

12.1 File and JFileChooser Objects 670


12.2 Low-Level File I/O 679
12.3 High-Level File I/O 684
12.4 Object I/O 693
12.5 Sample Development 700

13 Inheritance and Polymorphism 713

13.1 A Simple Example 714


13.2 Defining Classes with Inheritance 717
13.3 Using Classes Effectively with Polymorphism 721
13.4 Inheritance and Member Accessibility 724
13.5 Inheritance and Constructors 729
13.6 Abstract Superclasses and Abstract Methods 733
13.7 Inheritance versus Interface 738
13.8 Sample Development 739
wu23399_fm.qxd 1/10/07 11:53 Page x

x Contents

14 GUI and Event-Driven Programming 765

14.1 Simple GUI I/O with JOptionPane 768


14.2 Customizing Frame Windows 771
14.3 GUI Programming Basics 777
14.4 Text-Related GUI Components 787
14.5 Layout Managers 798
14.6 Effective Use of Nested Panels 808
14.7 Other GUI Components 817
14.8 Menus 835
14.9 Handling Mouse Events 839

15 Recursive Algorithms 859

15.1 Basic Elements of Recursion 860


15.2 Directory Listing 861
15.3 Anagram 863
15.4 Towers of Hanoi 866
15.5 Quicksort 868
15.6 When Not to Use Recursion 873

16 Memory Allocation Schemes and


Linked Data Structures 879
16.1 Contiguous Memory Allocation Scheme 881
16.2 Noncontiguous Memory Allocation Scheme 886
16.3 Manipulating Linked Lists 890
16.4 Linked Lists of Objects 903
16.5 Sample Development 908
wu23399_fm.qxd 1/10/07 11:53 Page xi

Contents xi

17 Generics and Type Safety 945

17.1 Generic Classes 946


17.2 Generics and Collections 961
17.3 Generics, Inheritance, and Java Interface 969
17.4 Additional Topics and Pitfalls 974

18 List ADT 981

18.1 The List ADT 982


18.2 The List Interface 988
18.3 The Array Implementation of the List ADT 992
18.4 The Linked-List Implementation
of the List ADT 1001
18.5 The Linked Implementation
with the Head Node 1018
18.6 The Iterator Design Pattern 1022
18.7 Sample Development 1027

19 Stack ADT 1035

19.1 The Stack ADT 1036


19.2 The Stack Interface 1040
19.3 The Array Implementation 1042
19.4 The Linked-List Implementation 1047
19.5 Implementation Using NPSList 1052
19.6 Sample Applications: Matching HTML Tags 1053
19.7 Sample Applications: Solving
a Maze with Backtracking 1060
wu23399_fm.qxd 1/10/07 11:53 Page xii

xii Contents

20 Queue ADT 1069

20.1 The Queue ADT 1070


20.2 The Queue Interface 1073
20.3 The Array Implementation 1075
20.4 The Linked-List Implementation 1082
20.5 Implementation Using NPSList 1088
20.6 Priority Queue 1089

Appendix A 1099

Appendix B 1107

Appendix C 1133

Appendix D 1155

Index 1163
wu23399_fm.qxd 1/10/07 11:53 Page xiii

Preface

T his book is an in-depth introduction to object-oriented programming using


the Java programming language. In addition to covering traditional topics for a CS1
course, some of the more advanced topics such as recursion and linked lists are in-
cluded to provide a comprehensive coverage of beginning to intermediate-level ma-
terials. There are more materials in the book than what are normally covered in a
typical CS1 course. An instructor may want to teach some of the chapters on data
structures in an advanced CS1 course. Topics covered in Chapters 16 to 20 are also
suitable for use in a CS2 course.

Key Differences from the Standard Edition


This comprehensive edition is based on An Introduction to Object-Oriented Pro-
gramming with Java, Fourth Edition. The key differences between this comprehen-
sive version and the fourth edition standard version are as follows:
1. Data Structures Chapters. Chapter 16 covers topics on managing linked
nodes. Using this as the foundation, Chapters 18 through 20 present three ab-
stract data types (ADTs) List, Stack, and Queue, respectively. For all three
ADTs, both array-based and linked-list implementations are shown, and their
relative advantages and disadvantages are discussed.
2. More Discussion on Java 5.0 Features. Many of the new Java 5.0 features
are explained and used in the sample programs. They include the enumerator
type, the for-each loop construct, auto boxing and unboxing, and the generics.
One complete chapter (Chapter 17) is dedicated to the generics.
3. Exclusive Use of Console Input and Output. All the GUI related topics,
including the JOptionPane class, are moved to Chapter 14. Sample programs
before Chapter 14 use the standard console input (Scanner) and output
(System.out). Those who want to use JOptionPane for simple input and output
can do so easily by covering Section 14.1 before Chapter 3.
xiii
wu23399_fm.qxd 1/10/07 11:53 Page xiv

xiv Preface

Book Organization
There are 21 chapters in this book, numbered from 0 to 20. The first 11 chapters
cover the core topics that provide the fundamentals of programming. Chapters 11 to
15 cover intermediate-level topics such as sorting, searching, recursion, inheritance,
polymorphism, and file I/O. And Chapters 16 to 20 cover topics related to data
structures. There are more than enough topics for one semester. After the first
11 chapters (Ch 0 to Ch 10), instructors can mix and match materials from Chapters 11
to 20 to suit their needs. We first show the dependency relationships among the
chapters and then provide a brief summary of each chapter.

Chapter Dependency
For the most part, chapters should be read in sequence, but some variations are
possible, especially with the optional chapters. Here’s a simplified dependency
graph:

0
1

4
5

6
7

8 9 10
*Note: Some examples use arrays,
11 12 13 14* 15 16 but the use of arrays is not an
integral part of the examples.
These examples can be modified
to those that do not use arrays.
17 18 Many topics from the early part
of the chapter can be introduced
19 20 as early as after Chapter 2.
wu23399_fm.qxd 1/10/07 11:54 Page xv

Preface xv

Brief Chapter Summary


Here is a short description of each chapter:
• Chapter 0 is an optional chapter. We provide background information on
computers and programming languages. This chapter can be skipped or as-
signed as an outside reading if you wish to start with object-oriented pro-
gramming concepts.
• Chapter 1 provides a conceptual foundation of object-oriented programming.
We describe the key components of object-oriented programming and illus-
trate each concept with a diagrammatic notation using UML.
• Chapter 2 covers the basics of Java programming and the process of editing,
compiling, and running a program. From the first sample program presented in
this chapter, we emphasize object-orientation. We will introduce the standard
classes String, Date, and SimpleDateFormat so we can reinforce the notion of
object declaration, creation, and usage. Moreover, by using these standard
classes, students can immediately start writing practical programs.We describe
and illustrate console input with System.in and the new Scanner class and output
with System.out.
• Chapter 3 introduces variables, constants, and expressions for manipulating
numerical data. We explain the standard Math class from java.lang and
introduce more standard classes (GregorianCalendar and DecimalFormat) to
continually reinforce the notion of object-orientation. We describe additional
methods of the Scanner class to input numerical values. Random number
generation is introduced in this chapter. The optional section explains how the
numerical values are represented in memory space.
• Chapter 4 teaches the basics of creating programmer-defined classes. We
keep the chapter accessible by introducting only the fundamentals with illus-
trative examples. The key topics covered in this chapter are constructors, vis-
ibility modifiers (public and private), local variables, and passing data to
methods. We provide easy-to-grasp illustrations that capture the essence of
the topics so the students will have a clear understanding of them.
• Chapter 5 explains the selection statements if and switch. We cover boolean
expressions and nested-if statements. We explain how objects are compared
by using equivalence (==) and equality (the equals and compareTo methods).
We use the String and the programmer-defined Fraction classes to make the
distinction between the equivalence and equality clear. Drawing 2-D graphics
is introduced, and a screensaver sample development program is developed.
We describe the new Java 5.0 feature called enumerated type in this chapter.
• Chapter 6 explains the repetition statements while, do–while, and for. Pitfalls
in writing repetition statements are explained. One of the pitfalls to avoid is
the use of float or double for the data type of a counter variable. We illustrate
this pitfall by showing a code that will result in infinite loop. Finding the great-
est common divisor of two integers is used as an example of a nontrivial loop
statement. We show the difference between the straightforward (brute-force)
wu23399_fm.qxd 1/10/07 11:54 Page xvi

xvi Preface

and the clever (Euclid’s) solutions. We introduce the Formatter class (new to
Java 5.0) and show how the output can be aligned nicely. The optional last sec-
tion of the chapter introduces recursion as another technique for repetition.
The recursive version of a method that finds the greatest common divisor of
two integers is given.
• Chapter 7 is the second part of creating programmer-defined classes. We
introduce new topics related to the creation of programmer-defined classes
and also repeat some of the topics covered in Chapter 4 in more depth. The
key topics covered in this chapter are method overloading, the reserved
word this, class methods and variables, returning an object from a method,
and pass-by-value parameter passing. As in Chapter 4, we provide many
lucid illustrations to make these topics accessible to beginners. We use the
Fraction class to illustrate many of these topics, such as the use of this and
class methods. The complete definition of the Fraction class is presented in
this chapter.
• Chapter 8 teaches exception handling and assertions. The focus of this chap-
ter is the construction of reliable programs. We provide a detailed coverage of
exception handling in this chapter. We introduce an assertion and show how it
can be used to improve the reliability of finished products by catching logical
errors early in the development.
• Chapter 9 covers nonnumerical data types: characters and strings. Both the
String and StringBuffer classes are explained in the chapter. Another string
class named StringBuilder (new to Java 5.) is briefly explained in this chapter.
An important application of string processing is pattern matching. We describe
pattern matching and regular expression in this chapter. We introduce the
Pattern and Matcher classes and show how they are used in pattern matching.
• Chapter 10 teaches arrays. We cover arrays of primitive data types and of ob-
jects. An array is a reference data type in Java, and we show how arrays are
passed to methods. We describe how to process two-dimensional arrays and
explain that a two-dimensional array is really an array of arrays in Java. Lists
and maps are introduced as a more general and flexible way to maintain a col-
lection of data. The use of ArrayList and HashMap classes from the java.util
package is shown in the sample programs. Also, we show how the WordList
helper class used in Chapter 9 sample development program is implemented
with another map class called TreeMap.
• Chapter 11 presents searching and sorting algorithms. Both N2 and Nlog2N
sorting algorithms are covered. The mathematical analysis of searching and
sorting algorithms can be omitted depending on the students’ background.
• Chapter 12 explains the file I/O. Standard classes such as File and JFile-
Chooser are explained. We cover all types of file I/O, from a low-level byte
I/O to a high-level object I/O. We show how the file I/O techniques are used
to implement the helper classes—Dorm and FileManager—in Chapter 8 and 9
sample development programs. The use of the Scanner class for inputting data
from a textfile is also illustrated in this chapter.
wu23399_fm.qxd 1/10/07 11:54 Page xvii

Preface xvii

• Chapter 13 discusses inheritance and polymorphism and how to use them ef-
fectively in program design. The effect of inheritance for member accessibil-
ity and constructors is explained. We also explain the purpose of abstract
classes and abstract methods.
• Chapter 14 covers GUI and event-driven programming. Only the Swing-
based GUI components are covered in this chapter. We show how to use the
JOptionPane class for a very simple GUI-based input and output. GUI com-
ponents introduced in this chapter include JButton, JLabel, ImageIcon,
JTextField, JTextArea, and menu-related classes. We describe the effective use
of nested panels and layout managers. Handling of mouse events is described
and illustrated in the sample programs. Those who do not teach GUI can skip
this chapter altogether. Those who teach GUI can introduce the beginning part
of the chapter as early as after Chapter 2.
• Chapter 15 covers recursion. Because we want to show the examples where
the use of recursion really shines, we did not include any recursive algorithm
(other than those used for explanation purposes) that really should be written
nonrecursively.
• Chapter 16 covers contiguous and noncontiguous memory allocation schemes
and introduces the concept of linked lists. Ample examples are provided to
illustrate the manipulation of linked lists of primitive data types and linked
lists of objects. This chapter lays the necessary foundation for the students to
learn different techniques for implementing the abstract data types covered in
Chapters 18 through 20.
• Chapter 17 covers new Java 5.0 generics in detail. The chapter describes how
generic classes are defined and how the type safety is supported by generics.
A concrete example of using generics is shown by defining a simple linked list
with generic nodes.
• Chapter 18 introduces the concept of abstract data types (ADT) and covers
the List ADT. Key features of the List ADT are explained and two implemen-
tations using an array and a linked list are shown. The iterator pattern to tra-
verse the elements in the List ADT is introduced.
• Chapter 19 covers the Stack ADT. Key features of the Stack ADT are ex-
plained and two implementations using an array and a linked list are shown.
Sample applications that use stacks are described.
• Chapter 20 covers the Queue ADT. Key features of the Stack ADT are ex-
plained and two implementations using an array and a linked list are shown.
A special type of queue called a priority queue is also intoduced in this
chapter.
wu23399_fm.qxd 1/10/07 11:54 Page xviii

xviii Preface

Hallmark Features of the Text

Problem Solving

Sample Development Programs


Sample Development
2.5 Sample Development
Most chapters include a sample
Printing the Initials
development section that describes the
Now that we have acquired a basic understanding of Java application programs, let’s
write a new application. We will go through the design, coding, and testing phases of the process of incremental development.
software life cycle to illustrate the development process. Since the program we develop
here is very simple, we can write it without really going through the phases. However, it is
extremely important for you to get into a habit of developing a program by following the
software life cycle stages. Small programs can be developed in a haphazard manner, but
not large programs.We will teach you the development process with small programs first,
so you will be ready to use it to create large programs later.
We will develop this program by using an incremental development technique,
which will develop the program in small incremental steps. We start out with a bare-
bones program and gradually build up the program by adding more and more code to
it. At each incremental step, we design, code, and test the program before moving on
to the next step. This methodical development of a program allows us to focus our at-
tention on a single task at each step, and this reduces the chance of introducing errors
into the program.

Problem Statement
We start our development with a problem statement. The problem statement for our
sample programs will be short, ranging from a sentence to a paragraph, but the problem
statement for complex and advanced applications may contain many pages. Here’s the
problem statement for this sample development exercise:
Write an application that asks for the user’s first, middle, and last names and
replies with the user’s initials.

Overall Plan
Our first task is to map out the overall plan for development. We will identify classes nec-
essary for the program and the steps we will follow to implement the program.We begin
with the outline of program logic. For a simple program such as this one, it is kind of obvi-
ous; but to practice the incremental development, let’s put down the outline of program
flow explicitly. We can express the program flow as having three tasks:

program 1. Get the user’s first, middle, and last names.


tasks
2. Extract the initials to formulate the monogram.
3. Output the monogram.
Having identified the three major tasks of the program, we will now identify the
classes we can use to implement the three tasks. First, we need an object to handle the
input. At this point, we have learned about only the Scanner class, so we will use it
here. Second, we need an object to display the result. Again, we will use System.out, as
it is the only one we know at this point for displaying a string value. For the string

Development Exercises Development Exercises


give students an opportunity For the following exercises, use the incremental development methodology to
to practice incremental implement the program. For each exercise, identify the program tasks, create a
design document with class descriptions, and draw the program diagram. Map
development. out the development steps at the start. Present any design alternatives and
justify your selection. Be sure to perform adequate testing at the end of each
development step.
8. In the sample development, we developed the user module of the keyless
entry system. For this exercise, implement the administrative module that
allows the system administrator to add and delete Resident objects and
modify information on existing Resident objects. The module will also allow
the user to open a list from a file and save the list to a file. Is it proper to
implement the administrative module by using one class? Wouldn’t it be a
better design if we used multiple classes with each class doing a single,
well-defined task?
9. Write an application that maintains the membership lists of five social clubs
in a dormitory. The five social clubs are the Computer Science Club, Biology
Club, Billiard Club, No Sleep Club, and Wine Tasting Club. Use the Dorm
wu23399_fm.qxd 1/10/07 11:55 Page xix

Preface xix

Object-Oriented Approach
We take the object-first approach to teaching object-oriented programming with emphasis
on proper object-oriented design.The concept of objects is clearly illustrated from the very
first sample program.

/*

Chapter 2 Sample Program: Displaying a Window

File: Ch2Sample1.java

*/

import javax.swing.*;

class Ch2Sample1 {

public static void main(String[] args) {

JFrame myWindow;

myWindow = new JFrame();

myWindow.setSize(300, 200);
myWindow.setTitle("My First Java Program");
myWindow.setVisible(true);
}
}

Good practices on object-


oriented design are
discussed throughout
User module Dorm Resident
the book and illustrated
through numerous
sample programs. Door

Administrative Dorm Resident


module

A helper class A class we One or more classes


provided to us implement we implement

Figure 8.8 Program diagrams for the user and administrative modules. Notice the same Dorm and
Resident classes are used in both programs. User and administrative modules will include one or more
classes (at least one is programmer-defined).
wu23399_fm.qxd 1/10/07 11:55 Page xx

xx Preface

Illustrative Diagrams
Illustrative diagrams are used to explain all key concepts of programming such as the
difference between object declaration and creation, the distinction between the primitive
data type and the reference data type, the call-by-value parameter passing, inheritance, and
many others.

Numerical Data Object

int number1, number2; Professor alan, turing;


number1 = 237; alan = new Professor();
number2 = number1; turing = alan;

number1 alan

number2 turing

int number1, number2; Professor alan, turing;


number1 = 237; alan = new Professor();
number2 = number1; turing = alan;

number1 237 alan

number2 turing

:Professor

int number1, number2; Professor alan, turing;


number1 = 237; alan = new Professor();

number2 = number1; turing = alan;

number1 237 alan

number2 237 turing

:Professor

Figure 3.3 An effect of assigning the content of one variable to another.

Lucid diagrams are used effectively to explain myList


data structures and abstract data types.
0 1 2 3
Before “cat” “ape” “dog” “bee”

add(1, “gnu”)

myList

0 1 2 3 4
After “cat” “gnu” “ape” “dog” “bee”

myList

0 1 2 3
Before “cat” “ape” “dog” “bee”

throws
add(5, “gnu”) <index-out-of-bounds-exception>

myList

0 1 2 3
“cat” “ape” “dog” “bee” No structural
After
change to the list

Figure 18.2 Sample version 2 add operations on myList.


wu23399_fm.qxd 1/10/07 11:55 Page xxi

Preface xxi

Student Pedagogy
Design Guidelines
provide tips on good
Always define a constructor and initialize data members fully in the
constructor so an object will be created in a valid state. program design.

Things to Remember
boxes provide tips for List the catch blocks in the order of specialized to more general exception classes.
students to remember key At most one catch block is executed, and all other catch blocks are ignored.
concepts.

Tips, Hints, and Pitfalls


It is not necessary to create an object for every variable we use. Many novice pro-
grammers often make this mistake. For example, we write provide important points
for which to watch out.
Fraction f1, f2;
f1 = new Fraction(24, 36);
f2 = f1.simplify( );

We didn’t write

Fraction f1, f2;


f1 = new Fraction(24, 36);
f2 = new Fraction(1, 1); //not necessary
f2 = f1.simplify( );

because it is not necessary. The simplify method returns a Fraction object, and in
the calling program, all we need is a name we can use to refer to this returned
Fraction object. Don’t forget that the object name (variable) and the actual object
instance are two separate things.

You Might Want to Know


We can turn our simulation program into a real one by replacing the Door
boxes give students
class with a class that actually controls the door. Java provides a mechanism
interesting bits of called Java Native Interface (JNI) which can be used to embed a link to a low-
information. level device driver code, so calling the open method actually unlocks the
door.

Quick Check
1. What will be displayed on the console window when the following code is exercises at the end of
executed and the user enters abc123 and 14? the sections allow
Scanner scanner = new Scanner(System.in);
students to test their
try { comprehension of
int num1 = scanner.nextInt(); topics.
System.out.println("Input 1 accepted");
int num2 = scanner.nextInt();
System.out.println("Input 2 accepted");
} catch (InputMismatchException e) {
System.out.println("Invalid Entry");
}
wu23399_fm.qxd 1/10/07 11:55 Page xxii

xxii Preface

Supplements for Instructors and Students


On-Line Learning Center is located at www.mhhe.com/wu

For Instructors
• Complete set of PowerPoints, including lecture notes and figures.

• Complete solutions for the exercises


• Example Bank—Additional examples, which are searchable by topic, are
provided online in a “bank” for instructors.
• Homework Manager/Test Bank—Conceptual review questions are stored in
this electronic question bank and can be assigned as exam questions or home-
work.
• Online labs which accompany this text, can be used in a closed lab, open lab,
or for assigned programming projects.
wu23399_fm.qxd 1/10/07 11:55 Page xxiii

Preface xxiii

For Students
• Compiler How Tos provide tutorials on how to get up and running on the
most popular compilers to aid students in using IDEs.

• Interactive Quizzes allow students to test what they learn and get immediate
feedback.
• Source code for all example programs in the book.
• Answers to quick check exercises.
• Glossary of key terms.
• Recent News links relevant to computer science.
• Additional Topics such as more on swing and an introduction to data structures.

Acknowledgments
First, I would like to thank the following reviewers for their comments, suggestions,
and encouragement.

Wu Focus Group—Jackson Hole, WY


Elizabeth Adams, James Madison University
GianMario Besana, Depaul University
Michael Buckley, State University of New York, Buffalo
James Cross, Auburn University
Priscilla Dodds, Georgia Perimeter College
Christopher Eliot, University of Massachusetts-Amherst
Joanne Houlahan, John Hopkins University
Len Myers, California Polytechnic State University, San Luis Obispo
Hal Perkins, University of Washington
William Shea, Kansas State University
Marge Skubic, University of Missouri, Columbia
Bill Sverdlik, Eastern Michigan University
Suzanne Westbrook, University of Arizona
wu23399_fm.qxd 1/10/07 11:56 Page xxiv

xxiv Preface

Reviewers
Ajith, Abraham, Oklahoma State University
Elizabeth Adams, James Madison University
David L. Atkins, University of Oregon
GianMario Besana, DePaul University
Robert P. Burton, Brigham Young University
Michael Buckley, State University of New York, Buffalo
Rama Chakrapani, Tennessee Technological University
Teresa Cole, Boise State University
James Cross, Auburn University
Priscilla Dodds, Georgia Perimeter College
Kossi Delali Edoh, Montclair State University
Christopher Eliot, University of Massachusetts-Amherst
Michael Floeser, Rochester Institute of Technology
Joanne Houlahan, John Hopkins University
Michael N. Huhns, University of South Carolina
Eliot Jacobson, University of California, Santa Barbara
Martin Kendall, Montgomery Community College
Mike Litman, Western Illinois University
Len Myers, California Polytechnic State University, San Luis Obispo
Jun Ni, University of Iowa
Robert Noonan, College of William and Mary
Jason S. O’Neal, Mississippi College
Hal Perkins, University of Washington
Gerald Ross, Lane Community College
William Shea, Kansas State University
Jason John Schwarz, North Carolina State University
Marge Skubic, University of Missouri, Columbia
Bill Sverdlik, Eastern Michigan University
Peter Stanchev, Kettering University
Krishnaprasad Thirunarayan, Wright State University
David Vineyard, Kettering University
Suzanne Westbrook, University of Arizona
Melissa Wiggins, Mississippi College
Zhiguang Xu, Valdosta State University.

The following reviewers have provided feedback on the chapters new to this
comprehensive edition:

Eric Matson, Wright State University


Tim Margush, University of Akron
Roxanne Canosa, Rochester Institute of Technology
Ivan Bajic, San Diego State University
Carolyn Miller, North Carolina State
Sunil Prabhakar, Purdue University
Weining Zhang, University of Texas, San Antonio
wu23399_fm.qxd 1/10/07 11:56 Page xxv

Preface xxv

Personal Story
In September, 2001, I changed my name for personal reasons. Prof C. Thomas
Wu is now Prof Thomas W. Otani. To maintain continuity and not to confuse peo-
ple, we continue to publish the book under my former name. For those who
care to find out a little about my personal history can do so by visiting my web-
site (www.drcaffeine.com).
wu23399_fm.qxd 1/10/07 11:56 Page xxvi
wu23392_ch00.qxd 12/12/06 17:23 Page 1

0 O b j e c t i v e s
Introduction to Computers
and Programming
Languages

After you have read and studied this chapter, you should be able to

• State briefly a history of computers. • Convert binary numbers to decimal numbers


and vice versa.
• Name and describe five major components of
the computer. • State the difference between the low-level and
high-level programming languages.

1
wu23392_ch00.qxd 12/12/06 17:23 Page 2

2 Chapter 0 Introduction to Computers and Programming Languages

I n t r o d u c t i o n

B efore we embark on our study of computer programming, we will present some


background information on computers and programming languages in this optional
chapter. We provide a brief history of computers from the early days to present and
describe the components found in today’s computers. We also present a brief history
of programming languages from low-level machine languages to today’s object-
oriented languages.

0.1 A History of Computers


Humans have evolved from a primitive to a highly advanced society by continually
inventing tools. Stone tools, gunpowder, wheels, and other inventions have changed
the lives of humans dramatically. In recent history, the computer is arguably the
most important invention. In today’s highly advanced society, computers affect our
lives 24 hours a day: class schedules are formulated by computers, student records
are maintained by computers, exams are graded by computers, dorm security sys-
tems are monitored by computers, and numerous other functions that affect us are
controlled by computers.
Although the first true computer was invented in the 1940s, the concept of a
Charles computer is actually more than 160 years old. Charles Babbage is credited with
Babbage inventing a precursor to the modern computer. In 1823 he received a grant from
the British government to build a mechanical device he called the Difference
Difference Engine, intended for computing and printing mathematical tables. The device was
Engine
based on rotating wheels and was operated by a single crank. Unfortunately, the
technology of the time was not advanced enough to build the device. He ran into
difficulties and eventually abandoned the project.
But an even more grandiose scheme was already with him. In fact, one of the
reasons he gave up on the Difference Engine may have been to work on his new con-
Analytical cept for a better machine. He called his new device the Analytical Engine. This
Engine device, too, was never built. His second device also was ahead of its time; the tech-
nology did not yet exist to make the device a reality. Although never built, the Ana-
lytical Engine was a remarkable achievement because its design was essentially
based on the same fundamental principles of the modern computer. One principle
that stands out was its programmability. With the Difference Engine, Babbage would
have been able to compute only mathematical tables, but with the Analytical Engine
he would have been able to compute any calculation by inputting instructions on
punch cards. The method of inputting programs to computers on punch cards was
actually adopted for real machines and was still in wide use as late as the 1970s.
The Analytical Engine was never built, but a demonstration program was
Ada Lovelace written by Ada Lovelace, a daughter of the poet Lord Byron. The programming lan-
guage Ada was named in honor of Lady Lovelace, the first computer programmer.
In the late 1930s John Atanasoff of Iowa State University, with his graduate
student Clifford Berry, built the prototype of the first automatic electronic calculator.
wu23392_ch00.qxd 12/12/06 17:23 Page 3

0.1 A History of Computers 3

One innovation of their machine was the use of binary numbers. (We discuss binary
numbers in Sec. 0.2.) At around the same time, Howard Aiken of Harvard University
was working on the Automatic Sequence-Controlled Calculator, known more com-
MARK I monly as MARK I, with support from IBM and the U.S. Navy. MARK I was very
similar to the Analytical Engine in design and was described as “Babbage’s dream
come true.”
MARK I was an electromechanical computer based on relays. Mechanical
relays were not fast enough, and MARK I was quickly replaced by machines based
ENIAC I on electronic vacuum tubes. The first completely electronic computer, ENIAC I
(Electronic Numerical Integrator And Calculator), was built at the University of
Pennsylvania under the supervision of John W. Mauchly and J. Presper Eckert.
Their work was influenced by the work of John Atanasoff.
ENIAC I was programmed laboriously by plugging wires into a control
panel that resembled an old telephone switchboard. Programming took an enor-
mous amount of the engineers’ time, and even making a simple change to a pro-
gram was a time-consuming effort. While programming activities were going on,
the expensive computer sat idle. To improve its productivity, John von Neumann
of Princeton University proposed storing programs in the computer’s memory.
stored program This stored program scheme not only improved computation speed but also al-
lowed far more flexible ways of writing programs. For example, because a pro-
gram is stored in the memory, the computer can change the program instructions
to alter the sequence of the execution, thereby making it possible to get different
results from a single program.
generations of We characterized these early computers with vacuum tubes as first-generation
computers computers. Second-generation computers, with transistors replacing the vacuum
tubes, started appearing in the late 1950s. Improvements in memory devices also
increased processing speed further. In the early 1960s, transistors were replaced by
integrated circuits, and third-generation computers emerged. A single integrated
circuit of this period incorporated hundreds of transistors and made the construction
of minicomputers possible. Minicomputers are small enough to be placed on desk-
tops in individual offices and labs. The early computers, on the other hand, were so
huge that they easily occupied the whole basement of a large building.
Advancement of integrated circuits was phenomenal. Large-scale integrated
circuits, commonly known as computer chips or silicon chips, packed the power
equivalent to thousands of transistors and made the notion of a “computer on a sin-
gle chip” a reality. With large-scale integrated circuits, microcomputers emerged in
the mid-1970s. The machines we call personal computers today are descendants of
the microcomputers of the 1970s. The computer chips used in today’s personal
computers pack the power equivalent to several millions of transistors. Personal
computers are fourth-generation computers.
Early microcomputers were isolated, stand-alone machines. The word per-
sonal describes a machine as a personal device intended to be used by an individual.
However, it did not take long to realize there was a need to share computer resources.
For example, early microcomputers required a dedicated printer. Wouldn’t it make
more sense to have many computers share a single printer? Wouldn’t it also make
sense to share data among computers, instead of duplicating the same data on
wu23392_ch00.qxd 12/12/06 17:23 Page 4

4 Chapter 0 Introduction to Computers and Programming Languages

individual machines? Wouldn’t it be nice to send electronic messages between the


computers? The notion of networked computers arose to meet these needs.
network Computers of all kinds are connected into a network. A network that connects
computers in a single building or in several nearby buildings is called a local-area
LAN network or LAN. A network that connects geographically dispersed computers is
called a wide-area network or WAN. These individual networks can be connected
WAN
further to form interconnected networks called internets. The most famous internet
is simply called the Internet. The Internet makes the sharing of worldwide informa-
internet
tion possible and easy. The hottest tool for viewing information on the Internet is a
Web browser. A Web browser allows you to experience multimedia information
consisting of text, audio, video, and other types of information. We will describe
how Java is related to the Internet and Web browsers in Section 0.4.

If you want to learn more about the history of computing, there is a wealth of information
available on the Web.You can start your exploration from
www.yahoo.com/Computers_and_Internet/History
For more information on the pioneers of computers, visit
en.wikipedia.org/wiki/category:Computer_pioneers

1. Who was the first computer programmer?


2. Who designed the Difference Engine and Analytical Engine?
3. How many generations of computers are there?

0.2 Computer Architecture


A typical computer today has five basic components: RAM, CPU, storage devices,
I/O (input/output) devices, and communication devices. Figure 0.1 illustrates these
five components. Before we describe the components of a computer, we will explain
the binary numbering system used in a computer.

Binary Numbers
To understand the binary number system, let’s first review the decimal number sys-
tem in which we use 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. To represent a number in
the decimal system, we use a sequence of one or more of these digits. The value that
each digit in the sequence represents depends on its position. For example, consider
the numbers 234 and 324. The digit 2 in the first number represents 200, whereas
the digit 2 in the second number represents 20. A position in a sequence has a
value that is an integral power of 10. The following diagram illustrates how the
wu23392_ch00.qxd 12/12/06 17:23 Page 5

0.2 Computer Architecture 5

Output
Devices
RAM

Communication
CPU
Devices
Storage
Devices
Input
Devices

Monitor
Printer (output device)
(output device)
Main Unit (housing
CPU, RAM, storage
devices, and
communication
devices)

Keyboard Mouse
(input device) (input device)

Figure 0.1 A simplified view of an architecture for a typical computer.

values of positions are determined:


Decimal
Point

••• • •••
1
104 103 102 101 100 10 102 103
Position Values
The value of a decimal number (represented as a sequence of digits) is the sum
of the digits, multiplied by their position values, as illustrated:

2 4 8 • 7

102 101 100 101


 2  102  4  101  8  100  7  101

 2  100  4  10  8  1  7  110

 200  40 8  710  248.7


wu23392_ch00.qxd 12/12/06 17:23 Page 6

6 Chapter 0 Introduction to Computers and Programming Languages

base-2 In the decimal number system, we have 10 symbols, and the position values
numbers are integral powers of 10. We say that 10 is the base or radix of the decimal number
system. The binary number system works the same as the decimal number system
binary number but uses 2 as its base. The binary number system has two digits (0 and 1) called bits,
and position values are integral powers of 2. The following diagram illustrates how
bits the values of positions are determined in the binary system:

Binary
Point

••• • •••
24 23 22 21 20 21 22 23
Position Values

The value of a binary number (represented as a sequence of bits) is the sum of


the bits, multiplied by their position values, as illustrated:

1 0 1 • 1

22 21 20 21

binary-to-  1  22  0  21  1  20  1  21
decimal
 1  4  0  2  1  1  1  12
conversion
4 0 1  12  5.5

So the binary number 101.1 is numerically equivalent to the decimal num-


ber 5.5. This illustration shows how to convert a given binary number to the
decimal equivalent. How about converting a given decimal number to its binary
equivalent?
The following steps show how to convert a decimal number (only the whole
numbers) to the equivalent binary number. The basic idea goes something like
this:

decimal-to- 1. Divide the number by 2.


binary 2. The remainder is the bit value of the 20 position.
conversion
3. Divide the quotient by 2.
4. The remainder is the bit value of the 21 position.
5. Divide the quotient by 2.
6. The remainder is the bit value of the 22 position.
7. Repeat the procedure until you cannot divide any further, that is, until the
quotient becomes 0.
wu23392_ch00.qxd 12/12/06 17:23 Page 7

0.2 Computer Architecture 7

The following diagram illustrates the conversion of decimal number 25.

Division Division Division Division Division


#5 #4 #3 #2 #1
0 1 3 6 12
11
21 31
21 61
21 121
21 21251
0 2 6 12 24
1 1 0 0 1
24 23 22 21 20
16  8  0  0  1  25

The binary system is more suitable for computers than the decimal system be-
cause it is far easier to design an electrical device that can distinguish two states
(bits 0 and 1) than 10 states (digits 0 through 9). For example, we can represent 1 by
turning the switch on and 0 by turning the switch off. In a real computer, 0 is repre-
sented by electrical voltage below a certain level and 1 by electrical voltage at or
above this level.

When you pay closer attention to the on/off switch on computers and other
electronic devices, you should notice an icon like this

This is a stylized representation of binary digits 0 and 1.

RAM
RAM Random access memory or RAM is a repository for both program instructions and
data manipulated by the program during execution. RAM is divided into cells,
byte with each cell having a unique address. Typically, each cell consists of 4 bytes (B),
and a single byte (1 B) in turn consists of 8 bits. Each bit, which can be either on
or off, represents a single binary digit. RAM is measured by the number of bytes
it contains. For example, 128 kilobytes (KB) of RAM contains 128  1024 
131,072 B because 1 KB is equal to 210  1024 B. Notice that 1 K is not equal to
103, although 103  1000 is a close approximation to 210  1024. The first IBM
PC introduced in 1981 came with 16 KB of RAM, and the first Macintosh com-
puter introduced in 1984 came with 128 KB of RAM. In contrast, a typical PC
today has anywhere from 128 MB to 512 MB of RAM. Given that 1 MB is equal
to 1024 KB, we know that 256 MB means 256  1024 KB  262,144 KB 
262,144  1024 B  268,435,456 B.
wu23392_ch00.qxd 12/12/06 17:23 Page 8

8 Chapter 0 Introduction to Computers and Programming Languages

CPU
CPU The central processing unit or CPU is the brain of a computer. The CPU is the com-
ponent that executes program instructions by fetching an instruction (stored in
RAM), executing it, fetching the next instruction, executing it, and so on until it en-
register counters an instruction to stop. The CPU contains a small number of registers, which
are high-speed devices for storing data or instructions temporarily. The CPU also
contains the arithmetic-logic unit (ALU), which performs arithmetic operations such
as addition and subtraction and logical operations such as comparing two numbers.
clock speed CPUs are characterized by their clock speeds. For example, in the Intel
Pentium 200, the CPU has a clock speed of 200 megahertz (MHz). The hertz is a
unit of frequency equal to 1 cycle per second. A cycle is a period of time between
two on states or off states. So 200 MHz equals 200,000,000 cycles per second. The
fastest CPU for commercially available personal computers was around 200 MHz
in 1997 when the first edition of this textbook was published. But by the beginning
of 1998, many vendors started selling 300-MHz machines. And in a mere 6 months,
by the middle of 1998, the top-of-the-line personal computers were 400-MHz ma-
chines. As of this writing in late 2002, we see computers with 2.0-GHz (2000-MHz)
CPU being advertised and sold. The increase of the CPU speed in the last two
decades is truly astonishing. The clock speed of the Intel 8080, the CPU introduced
in 1974 that started the PC revolution, was a mere 2 MHz. In contrast, the clock
speed of the Intel Pentium 4 introduced in 2001 was 2 GHz (2000 MHz). Table 0.1
lists some of the Intel processors.

I/O Devices
I/O devices Input/output or I/O devices allow communication between the user and the CPU.
Input devices such as keyboards and mice are used to enter data, programs, and
commands in the CPU. Output devices such as monitors and printers are used to
display or print information. Other I/O devices include scanners, bar code readers,
magnetic strip readers, digital video cameras, and musical instrument digital inter-
face (MIDI) devices.

Storage Devices
Storage devices such as disk and tape drives are used to store data and programs. Sec-
nonvolatile and ondary storage devices are called nonvolatile memory, while RAM is called volatile
volatile memory. Volatile means the data stored in a device will be lost when the power to the
memory
device is turned off. Being nonvolatile and much cheaper than RAM, secondary stor-
age is an ideal medium for permanent storage of large volumes of data. A secondary
storage device cannot replace RAM, though, because secondary storage is far slower
in data access (getting data out and writing data in) compared to RAM.
The most common storage device today for personal computers is a disk
drive. There are two kinds of disks: hard and floppy (also known as diskettes). Hard
disks provide much faster performance and larger capacity, but are normally not re-
movable; that is, a single hard disk is permanently attached to a disk drive. Floppy
disks, on the other hand, are removable, but their performance is far slower and
their capacity far smaller than those of hard disks. As the standard floppy disks can
wu23392_ch00.qxd 12/12/06 17:23 Page 9

0.2 Computer Architecture 9

A table of Intel processors. For some CPUs, several types with different
Table 0.1 clock speeds are possible. In such case, only the fastest clock speed is
shown. For more information on Intel CPUs, visit http://www.intel.com.

Table CPU
Date
Introduced
Clock Speed
(MHz)
4004 11/15/71 0.108
8008 4/1/72 0.200
1970s 8080 4/1/74 2
8088 6/1/79 8

80286 2/1/82 12
1980s 80386SX 6/16/88 16
80486DX 4/10/89 25

Pentium 3/22/93 66
Pentium Pro 11/1/95 200
1990s Pentium II 5/7/97 300
Pentium II Xeon 6/29/98 400
Pentium III 10/25/99 733

Xeon 9/25/01 2000


Pentium 4 4/27/01 2000
2000s Itanium 2 7/8/02 1000
Pentium 4 Extreme 2/2/04 3400
Edition
Core 2 Extreme 7/27/06 3200

store only up to approximately 1.44 MB, they are becoming less useful in today’s
world of multimegabyte image and sound files. They are fast becoming obsolete,
and hardly anybody uses them anymore. Removable storage media with much
higher capacity such as zip disks (capable of holding 100 to 250 MB of data) re-
placed floppy disks in late 1990s. Computer technology moves so quickly that zip
disks themselves are already becoming obsolete. The most common form of
portable storage medium today (2006) is a compact USB flash drive, whose capac-
ity ranges from 125 MB to 16 GB.
Hard disks can store a huge amount of data, typically ranging from 20 GB
(gigabyte; 1 GB  1024 MB) to 80 GB for a standard desktop PC in 2002. Portable
and removable hard disk drives, with performance and capacity that rival those of
nonremovable hard disks, are also available, but their use is not widespread.
Compact disks (CDs) are very popular today for storing massive amounts of
data, approximately 700 MB. Many software packages we buy today—computer
Other documents randomly have
different content
Päästyään mäen harjalle, näki hän hevosen syövän pienessä
heinäisessä laaksossa allaan. Eläin oli kirjava, epäsäännölliset
valkoiset läikät näkyivät oikeassa kyljessä, sä'ässä ja polvien
alapuolella. Nähdessään sen, veti Brannon suunsa tiukalle.

"Billy", sanoi hän hiljaa.

Yksi häiritsevä epätietoisuus oli taas hävinnyt. Jos Billy olisi vain
lähtenyt tallista tuoreen heinän hakuun, niin se ei olisi tullut
tännepäin, koska idässä päin oli heinää yltäkylläisesti ja vielä
lähempänä karjataloa ja siellä oli sitäpaitsi vettäkin.

Brannon hoputti molemmat hevosensa alas laaksoon ja lähestyi


Billyä hitaasti. Hän tahtoi nähdä sen tarkemmin.

Hän lassosi Billyn ja kiinnitti köyden mustan satulaan ja kun Billy


oli päässyt pahimmasta suuttumuksestaan, meni Brannon aivan sen
lähelle, tutkiakseen sitä ja sillä aikaa piti musta köyttä kireänä.

Billy oli ollut suljettuna talliin useamman päivän, jotta sitä olisi voitu
hoitaa paremmin vatsahäiriön vuoksi. Carson, hevospuoskari, oli
hoitanut sitä erikoisen huolellisesti, sukien sitä joka päivä. Brannon
oli myös usein pistäytynyt katsomassa, miten sen parantuminen
edistyi.

Sä'ässä oleva valkoinen läikkä oli tahrainen. Sen selässä näkyivät


satulan ja sen kyljissä tuntui alustan jäljet ja vatsan ympärillä tuntui
vieläkin syvät, hien haalistamat viivat, jotka siihen leveät mahavyöt
olivat puristaneet. Valkoisella läikällä olevat tahrat olivat verta ja niitä
näkyi ainoastaan vasemmalla puolella Billyn hartiaa, pitkinä kapeina
juovina.
Brannon irroitti lassonsa hevosesta ja ajoi sitä pitkän matkan
takaisinpäin ja seurasi sitä vielä jonkun ajan, kunnes Billy jatkoi
rauhallisesti raviaan kotiinpäin. Sitten Brannon taas lähti etelään.

Callahanin murha oli nyt Brannonille yhtä selvä, kuin jos se olisi
painettu paperille. Kannettuaan Callahanin ruumiin asuntoonsa, oli
Brannon tutkinut hänen asettaan ja huomannut, että yksi panos oli
ammuttu tyhjäksi. Koska hän oli tullut siihen johtopäätökseen, että
Josephine oli ampunut Callahanin, oli hän hämmästynyt tuota tyhjää
panosta ja hän päätteli lopuksi, että Callahan oli aikaisemmin
ampunut jotakin ja sitten huolimattomasti laiminlyönyt täyttää aseen
uudelleen.

Nyt oli selvää, että Les Artwell oli saanut tuon puuttuvan panoksen
ruumiiseensa, vaikka sen oli täytynyt tapahtua sangen kaukana
karjatalolta, sillä muutoin se varmasti olisi kuulunut. Senvuoksi oli
Artwellin myös täytynyt seurata Callahanin jälkiä ja ampua Starin
omistaja hänen kääntäessään selkänsä kuistille astuessaan.

Se tosiasia, että Artwell oli piiloutunut talliin, oli syynä siihen, ettei
Brannon, juostuaan kuistille heti laukauksen jälkeen, ollut kuullut
mitään kiireellistä kavion kapsetta, joka olisi ilmoittanut salakytän
pakenevan.

Josephine oli sattumalta tavannut Artwellin tallissa ja auttanut


häntä pakenemaan. Artwell oli pahasti haavoittunut ja Josephine oli
vienyt hänet Lattimerin talolle.

Ainoa hämärä seikka oli enää se, että Brannon oli löytänyt
satuloidun hevosen, jolla oli Lattimerin polttomerkki. Vaikka eihän
sekään asia ollut erikoisen hämmästyttävä, kun otti huomioon
satulan huonon kunnon, poikkinaiset ohjat ja nimikirjaimet
partasudissa, jonka Brannon oli löytänyt matkalaukussa. Artwell oli
tietenkin ratsastanut sillä hevosella, mutta oliko hän varastanut sen
Lattimerilta vai oliko Lattimer myynyt tai lainannut sen, siinä oli
kysymys. Se seikka, että Josephine oli vienyt Artwellin Lattimerin
karjatalolle, näytti todistavan, että heidän välillään vallitsi ystävyys ja
kaikenlainen ystävyys kunniallisenkin karjamiehen ja tunnetun
hevosvarkaan välillä oli epäilyttävä asia, joka vaati ankaraa
tutkimusta.

Oli miten oli, Brannon ei aikonut hiiskua epäilyksestään


sanaakaan. Ei hän myöskään aikonut heti ryhtyä vangitsemaan
Artwelliä. Hänen avullaan oli Artwell ensi kerralla joutunut kiinni ja
hän oli oikein iloinen nyt, että Josephine oli silloin tullut väliin. Hän oli
iloinen siitäkin, että Josephine taas oli sekaantunut asiaan. Sillä siten
menetellessään oli hän johtanut epäluulot Lattimeriinkin, oli
aiheuttanut asiassa uuden vaiheen, joka saattoi päättyä koko
varasjoukkueen vangitsemiseen, sen sijaan, että he muutoin olisivat
saaneet ainoastaan Artwellin kiinni.

Brannonin tyytyväisyyttä lisäsi vielä suuresti eräs toinen seikka —


se suuri huojennus, mitä hän tunsi päästessään perille siitä, että
Josephine ei ollutkaan ampunut Callahania. Hänen taistelunsa
Artwellin puolesta, hänen viimeiset edesottamisensa ja hänen
erehdyksensä ratsastaa hevosvarkaan kanssa Lattimerin karjatalolle
saattoi hyvin selittää hänen innokseen taistella niitten aatteitten
puolesta, joita hän jo oli aikaisemmin esittänyt ja puolustanut sekä
hänen päättäväiseksi, joskin hieman mielivaltaiseksi yrityksekseen
säätää lakia ihmisille uudessa, oudossa ympäristössään.

Mutta se tunne, joka syvimmin painui Brannonin tietoisuuteen,


joka täytti hänen sielunsa juhlallisella riemulla ja jota vastaan hän,
vaikka turhaan, koetti kyynillisellä iloisuudella taistella, johtui siitä
huomiosta, että Josephine oli valehdellut, pelastaakseen hänet!

Aurinko oli jo korkealla, kun Brannon ratsasti Lazy L:n karjatalon


kuistin luo ja pysäytti hevosensa siihen. Hän ei laskeutunut satulasta
ja tuomansa hevosen ohjat olivat hänen vasemmalla käsivarrellaan.

Lattimer, Denver ja Artwell kuulivat sisään Brannonin huudon. He


olivat nähneet hänet jo viisitoista minuuttia, ja kun musta pysähtyi
talon edustalle, komensi Lattimer Denveriä laskemaan aseensa,
jonka tämä oli kohottanut.

"Ei mitään sellaista, senkin hullu! Saisit vielä koko maakunnan


kimppuumme!"

Ensimmäisen ja toisen huutonsa väliaikana tarkasteli Brannon


ympäristöään. Verkalleen tutki hän karja-aitauksia, talon ympärillä
olevaa kenttää, erinäisiä rautakoron jälkiä kovalla pihamaalla ja
erikoisesti huomaten nelikulmaisen valkoisen liinan, joka rutistettuna
oli maassa kuistin nurkalla — naisen nenäliina.

Mutta hän ei osoittanut vähintäkään hämmästystä tai mielenkiintoa


näkemäinsä johdosta. Ne tarkkaavat, epäluuloiset silmät, jotka talon
sisältä häntä katselivat, eivät pystyneet välittämään omistajiensa
aivoille Brannonin katseessa mitään, joka osoittaisi, että hän näki
jotakin tavatonta.

Ja sittenkin, paitsi tuota nenäliinaa, oli Brannonin tarkkaava silmä


huomannut muitakin todistuksia siitä, että talossa oli vieraita.
Denverin hevonen oli aitauksessa.
Brannon tunsi, että häntä pidettiin silmällä. Mutta hän ei näyttänyt
merkkiäkään hämmennyksestä tai epäluulosta. Tuomansa hevosen
ohjat yhä käsivarrellaan, pyöräytti hän palturin, sytytti sen ja istuutui
rauhallisesti polttelemaan.

"Se on se hevonen, jonka annoin sinulle lainaksi, Artwell", sanoi


Lattimer. "Piru vieköön tuon miehen", nauroi hän, ihaillen julmalla
tavallaan Brannonin pelotonta käytöstä. "Hänellä on lujat hermot."

"Pojat, pysykää piilossa. Minun täytyy näyttäytyä, muutoin hän


tulee epäluuloiseksi", lisäsi hän.

Hän livahti ulos ovesta, juoksi ulkorakennuksen luo, kiersi sen ja


juostuaan kumarassa tallin luona olevan vajan taitse tuli esiin sen
toiselta puolelta. Hän vastasi Brannonin huutoon kiljaisemalla:

"Mikä hätänä?"

Brannon heilautti kättään tervehdykseksi ja käänsi hevosensa niin,


että Lattimer oli hänen edessään tullessaan lähemmä ja
hymyillessään teennäisen tervetuleman.

Brannonin hymyssä, vaikka se olikin yhtä epärehellinen, oli


enemmän sisältöä ja viekkautta, sillä hän oli nähnyt vilahdukselta
Lattimerin, kun tämä juoksi vajalta tallille.

"Olen tuonut sinulle hevosen, Lattimer", sanoi Brannon.

"Helvetti, sehän on Streak!" vastasi Lattimer. "Me kaipasimme sitä


— ja satulaa." Hän vastasi Brannonin rauhalliseen katseeseen
vakavasti. "Brannon", sanoi hän vihaisesti, "nuo varkaat alkavat tulla
liian rohkeiksi kun vievät hevosen suoraan ihmisten tallista!"
"Sellaisia ne ovat, Lattimer. Milloin hevonen katosi?"

"Eilen aamuna. Tallin ovi oli selkosen selällään. Missä tapasit sen,
Brannon?"

"Noin kymmenen mailin päässä taaksepäin. Murray ja minä


olimme menossa eteläiselle laitumelle. Lähetin Murrayn jatkamaan
matkaansa."

Lattimer oli huomannut nenäliinan maassa. Se oli aivan hänen


lähellään ja hän pani jalkansa sen päälle. Hän katsahti nopeasti
Brannoniin, mutta arvattavasti ei Brannon ollut huomannut koko
liikettä, sillä hän puhalteli välinpitämättömänä sauhuja sätkästään.

"Olen hyvin kiitollinen sinulle, Brannon", sanoi Lattimer.

"Älä turhia levittele, Lattimer", sanoi Brannon, hymyillen


ystävällisesti.

"Varkaat eivät näy suosivan erikoisesti ketään. Tänä aamuna


katosi meiltä hevonen. Ja satula ja suitset myös. Mutta luulen, että
varas tarvitsi enemmän suitsia ja satulaa kuin hevosta, sillä kuuden
mailin päässä tapasin hevosen, tulossa kotiinpäin. Siinä näkyi kyllä
satulan ja suitsien jäljet, mutta ei mitään satulaa eikä suitsia. Kuka
lienee vienytkin ne, hänellä on varmaankin hevonen jossakin piilossa
tai sitten aikoo hän sellaisen hankkia. Et kai ole nähnyt kenenkään
ratsastavan tästä kahdella satulalla?"

"En edes yhdelläkään satulalla", nauroi Lattimer. "Tästä ei ole


mennyt ketään — ainakaan sen jälkeen kun minä nousin
vuoteeltani."
"No niin, luulenpa, että minun täytyy lähteä huomenna etelään.
Pistäyn katsomassa Ben Whitmanin äitiä mennessäni. Onko sinulla
mitään asiaa sinne?"

"Kerro hänelle, että minua ilahuttaa kuulla, että hän on parempi.


Kuulin, että hän oli sairastunut toissa yönä — samana yönä kun Tim
Callahan sai surmansa." Hän katsoi suoraan Brannoniin.

"En olisi koskaan uskonut sitä Timistä", sanoi Brannon. "Asiasta


on kaksi kertomusta, minun ja Miss Hamiltonin. Hän sanoo, että
Callahan ahdisti häntä. Mahdollisesti, en nähnyt sitä. Miss Hamilton
vastusti häntä, arvatenkin ja sulki oven. Sillä kun minä tulin paikalle
oli ovi kiinni ja Callahan seisoi rapulla. Minä ammuin hänet siinä
luulossa, että hän oli Denver, joka oli ahdistellut tyttöä."

Brannon kertoi valheensa yhtä vakuuttavalla vakavuudella kuin


aikaisemmin Starin miesten kuulustelussa. Tietäen, että Brannon
valehteli, kasvoi Lattimerin kunnioitus melkoisesti tuota rautaisen
kylmäveristä miestä kohtaan.

Brannonkin tunsi, että Lattimer tiesi hänen valehtelevan sillä tähän


mennessä oli Artwellin täytynyt antaa joitakin viittauksia siitä, mitä
todellisuudessa oli tapahtunut.

Vaikka Brannonin ja Lattimerin välillä ei koskaan ollut vallinnut


minkäänlaista ystävyyttä eikä edes teennäistä sydämellisyyttäkään,
tunsivat he kumpikin toisiaan kohtaan tervettä kunnioitusta, joka
pohjautui niihin miehekkäisiin ominaisuuksiin, joita kumpikin
osoittivat omaavansa. Brannonin puolelta se perustui Lattimerin
hiomattomaan, toimintatarmoiseen miehekkyyteen, sekä siihen
avonaiseen, lujaan katseeseen, jonka hän hänen silmissään tapasi.
Hän ei ollut koskaan pitänyt Lattimerista ja hän tiesi yhtä ja toista
hänen käytöksestään naisia kohtaan, mutta hän tiesi myös, että
Lattimer saattoi olla oikeamielinen ystävä tai kunniallinen vihamies.

Lattimer kunnioitti Brannonia jotenkin samoilla perusteilla.


Seistessään siinä Brannonia vastapäätä, tiesi Lattimer, että
Brannonin sanat merkitsivät vain sitä, että vaikka hän olikin
epäluuloinen, ehkäpä varmakin asiastaan, aikoi hän siirtää
varsinaisen toimintansa siksi, kunnes hänellä oli käsissään
täydellinen, murhaava todistusaineisto.

"Cole Meeder kertoi minulle molemmat selonteot", sanoi Lattimer.


"Minä uskoin sitä, jonka Meeder sanoi Miss Hamiltonin kertoneen.
Koska Timiä oli ammuttu selkään, osoitti se sitä, että olit ampunut
hänet ilman edelläkäypää varoitusta, ja sitähän et olisi tehnyt, ellei
Callahan olisi yrittänyt sitä, niistä Miss Hamilton häntä syyttää."

Brannonin kasvoissa ei näkynyt mitään, huolimatta toisen


häpeällisen viekkaasta viittauksesta.

"Jos muistat, niin sanoin luulleeni Callahania Denveriksi ja


sellaisen koiran varoittamiseen ei minulla ollut aikaa."

Sattumoin, näköjään ilman mitään aihetta katsahti hän aitaukseen


päin ja keskitti katseensa Denverin hevoseen.

Lattimerin katse seurasi Brannonia tahtomattaan. Tumma puna


peitti
hänen poskensa ja niskansa, mutta kun hän salavihkaan katsoi
Brannoniin, ei tämä näyttänyt huomanneen mitään. Hän ei edes
katsonut
Lattimeriin. Mutta Lattimer pääsi pian tasapainoon taas.
"Denver, niin", sanoi hän liukkaasti, "jos katsot oikein tarkasti, niin
voit nähdä Denverin hevosen tuolla aitauksessa. Tuo kimo, jolla on
valkoiset vuohiskarvat. Denver tuli tämän kautta toissa aamuna
aikaiseen. Sanoi aikovansa länteen, Laskariin. Vaihdoin hänen
kanssaan erään mustan hevosen. Minua vähän ihmetytti hänen
äkillinen lähtönsä Triangle L:stä, mutta en viitsinyt kysellä. Nythän se
on vallan selvä asia. Sinullahan oli rettelöitä hänen kanssaan!"

"Joutavia", Brannonin hymy oli kylmä, halveksiva. "Mies ei


sellaisen roiston kanssa edes rettelöi, hän ottaa häneltä vain aseen
pois ja ajaa hänet matkoihinsa. Denverin aivot eivät juuri toimi
paljon, Lattimer. Hänelle täytyy sanoa asiat suoraan, jottei hän
käsittäisi niitä väärin. Jos hän olisi ollut kaukonäköinen kuten sinä,
Lattimer, niin minun ei olisi tarvinnut olla niin pikainen hänen
suhteensa."

Hän kääntyi nyt ja katsoi Lattimeriin. Hetkeksi tämän silmät


kylmenivät samoin kuin aikaisemmin sisällä Artwellille ja Denverille.
Sitten niihin tuli kylmän hyväksyvä ilme, johon sekoittui hyvä annos
häikäilemätöntä huumoria.

Brannon heitti Lazy L:n hevosen ohjat maahan, käänsi oman


hevosensa ja ratsasti pois pohjoiseen sanomatta edes
tavanmukaista "näkemiin" ja jättäen Lattimerin tuijottamaan
jälkeensä, täysin tietoisena siitä selvästä uhkauksesta, jonka
Brannon oli sisällyttänyt sanoihinsa, viitatessaan kaukonäköisiin
miehiin.

Yhdeksästoista luku.
Vaikka Betty oli koettanut parastaan ollakseen entiseen tapaansa
ystävällinen Josephineä kohtaan, oli Josephine kuitenkin huomannut
jäykkyyttä hänen käytöksessään sen jälkeen kun Betty oli tullut
Brannonin asunnosta.

Ensi kerran hänen vierailunsa aikana tapahtui nyt, että Betty ei


ollut saattanut häntä hänen huoneeseensa, istuakseen siellä sängyn
reunalla muutaman minuutin ja jutellakseen Josephinen kanssa
toimistaan ja huolistaan.

Josephine ei kuitenkaan ollut nähnyt mitään erikoista tuon pienen


iltakeskustelun laiminlyönnissä ennenkuin vasta ratsastaessaan tänä
aamuna Whitmanin mökille ja alkaessaan miettiä tekonsa oikeutusta,
viedessään Artwellin Lattimerin talolle. Hän muisteli varsinkin sitä
hämmästystä, joka kuvastui Bettyn ilmeissä illallisen ja varsin
kankean hyvänyön toivotuksen välillä ja hän rupesi sitä
suurentelemaan varsinaiseksi epäluuloksi.

Hän tunsi nyt suuttumusta siitä, ja hänen poskensa rupesivat


punottamaan. Niin, kun hän oikein tarkkaan ajatteli, niin lähenteli
Bettyn eilisiltainen käytös, hänen laiminlyöntinsä ja jäykkyytensä,
suorastaan loukkausta. Josephinelle selvisi nyt, ettei Betty ollut
uskonut hänen kertomustaan Callahanin kuolemasta!

Josephinen suuttumus tuntui oikeutetulta, kunnes hän muisti, että


hän oli valehdellut nähneensä, että Brannon ampui Starin omistajan
sekä että Callahan oli ahdistellut häntä itseään. Silloin hehkuivat
hänen poskensa uudelleen.

Mutta hän muisti, että kun hän oli kertonut Bettylle olleensa
Brannonin kanssa vain kahden karjatalolla sinä iltana, oli Betty
katsonut häneen terävästi ja että Betty vielä myöhemmin oli mennyt
Brannonin asuntoon. Josephine oli pitänyt häntä silmällä ja hän
muisti nyt, että Bettyn kylmyys häntä kohtaan oli alkanut sen jälkeen
kuin hän oli palannut Brannonin asunnosta.

Oliko mahdollista, että Betty ajatteli siinä olevan jotakin


moitittavaa, että Josephine oli ollut kahden Brannonin kanssa
karjatalolla sinä iltana? Epäilikö Betty, ettei Josephine ollut puhunut
totta kertoessaan Callahanin kuolemasta. Ja oliko Brannon ehkä
sanonut koko totuuden ja siten vahvistanut Josephinen
valheellisuuden?

Hän uskoi, että Brannon oli tehnyt juuri sen ja sen vuoksi mahtoi
hänen yrityksensä antaa Starin omistajan murhalle oikeutetun
leiman, näyttää Bettyn silmissä naurettavalta.

Josephinen pelottava leuka kasvoi vielä pelottavammaksi hänen


lähestyessään Whitmanin karjataloa. Lisääntynyt itsepäisyys, joka oli
seurauksena erinäisistä kapinallisista tunteista, sai hänen silmänsä
leimuamaan ja suunsa kovettumaan.

Jos Betty saattoi ajatella hänestä sellaista ja jos hän uskoi


ennemmin Brannonin sanaa kuin hänen, niin ei näyttänyt jäävän
muuta mahdollisuutta kuin panna tavaransa kokoon ja palata Itään.
Hän ei voisi kestää Bettyn epäluuloa. Hän ei voisi jäädä Triangle
L:ään, jos hänen jokaista liikettään tutkittaisiin siinä toivossa, että
niissä mahdollisesti havaittaisiin jotakin moitittavaa. Sellainen
asiaintila olisi sietämätön!

Ja sittenkin huomasi hän, että hänen olisi vaikea lähteä. Ovelat


voimat, joita hän ei olisi pystynyt selittämään, vaikka olisi
koettanutkin, vastustivat hänen kiivasta päätöstään.
Seudun juhlallinen suurenmoisuus rupesi lumoamaan häntä.
Salakavalana, ovelana ja asteettaisesti oli huomio seudun
neitseellisestä kauneudesta hänet vallannut, vaikka hän ei ehkä olisi
huomannut sen kiehtovaa voimaa, ellei olisi ollut kysymys sen
jättämisestä.

Mutta vaikka hän ihailikin tuota maata, olivat hänen ajatuksensa


Lattimerissä ja hän näki hänet yhä siinä asennossa, jossa hän seisoi
hänen edessään pitäen tuttavallisesti kättään hänen olkapäällään.

Vasten tahtoaan oli hän ollut Brannonin vaikutusvallan alla, tuntien


hänen kiihkeän voimansa ja vaistomaisesti tajunnut sen vetovoiman,
joka hänellä oli kaikkeen, mikä Josephinessä oli naisellista. Mutta
sitä vaikutusta, mikä Brannonilla häneen oli ollut, ei voinut verrata
siihen houkutukseen, minkä Lattimer aikaansai.

Lattimer oli suurempi kuin Brannon. Brannon oli kylmä, tunteeton


ja teräsmäisen silattu. Lattimer oli ruokkoamaton, syvästi
inhimillinen, vilkas ja kiihkeä — uinuva intohimojen tulimeri. Hän oli
vaara, jota sieti peljätä, arvoitus, jota kalpasi yrittää ratkaista ja
paljas uhkarohkeus tulla kosketuksiin hänen kanssaan, herättää
hänessä halu tavoitella itseään, oli Josephinesta sanomattoman
ihastuttavaa.

Ja niin hän, lopullisestikaan käsittämättä miksi, päätti olla


lähtemättä, huolimatta Bettyn käytöksen vuoksi tuntemastaan
suuttumuksestakaan.

Edellisellä käynnillään Whitmanilla hän ei ollut tavannut Ben


Whitmannia, ja kun hän ratsasti pienen karja-aitauksen portille, noin
sadan jalan päässä mökiltä, hämmästyi hän suuresti nähdessään
hoikan, kirkassilmäisen nuoren jättiläisen, joka tervehti häntä
sanoilla:

"Hyvää huomenta, ma'am."

Betty oli puhunut Mrs Whitmanin pojasta ja koska Mrs Whitman oli
pieni, hoikka ja hento, oli Josephine otaksunut, että poika olisi
samanlainen.

"Oletteko Mrs Whitmanin poika", kysyi hän.

"Olette osannut naulan päähän, ma'am", vastasi hän


pitkäveteisesti.

Hänen äänensä ei suinkaan ollut pieni eikä hento. Se oli


päinvastoin syvä, väräjävä ja ihastuttavan eteläinen, kuten hänen
kohtelias, kunnioittava kumarruksensakin, hänen hymyillessään
Josephinelle.

"Arvaan, että olette Miss Hamilton, ma'am", sanoi hän. —


Josephine koitti salata selvää hämmästystään. "Teidän täytyy olla
Miss Hamilton", jatkoi hän, "sillä te olette ainoa muukalainen näillä
mailla tällä hetkellä. Olette varmaankin tullut katsomaan äitiä?"

Hän auttoi Josephinen satulasta ja meni hänen edellään tupaan.


Josephine astui perässä ja ihmetteli kuinka täydellisen tietämätön
hän oli Josephinen läsnäolosta.

Ovella hän pysähtyi ja aukaisi sen Josephinelle.

"Te löydätte äidin seurusteluhuoneesta", sanoi hän ystävällisesti.


"Hän tulee erinomaisen iloiseksi nähdessään teidät, sillä hän on
puhunut teistä aina siitä saakka kun kävitte meillä." Hän hymyili vielä
kerran, kun Josephine astui sisään.

Josephinen oli hieman vaikea selittää käyntinsä tarkoitusta. Mutta


kun hän oli aloittanut, teki toipilaan ilmeinen myötätuntoisuus hänen
asiansa varsin helpoksi.

Mrs Whitman istui suuressa nojatuolissa ja hänen ympärilleen oli


sullottu pehmoisia pieluksia ja vaippoja. Hänen linnunsilmänsä, jotka
loistivat ystävällisyyttä ja osanottoa, eivät hetkeksikään kääntyneet
Josephinesta, tämän puhuessa.

"Kovin on pahoin Lesin laita", sanoi hän, kun Josephine oli


lopettanut. "Kyllä kerron Bettylle, että te olitte täällä koko yön. Siitä ei
ole mitään vahinkoa kenellekään. Les on kummallinen poika", jatkoi
hän. "Hänellä ei näy olevan vähääkään tahdon voimaa. Hän on aina
pulassa. Minä luulen, että muutamat ihmiset ovat syntyneet
sellaisiksi ja sen vuoksi meidän tavallisten ihmisten ei pitäisi olla liian
kovia heitä kohtaan." Hän hymyili Josephinelle. "Oletteko hyvä,
rakkaani, ja menette ovelle ja kutsutte Benin sisään."

Nuori jättiläinen tuli ääneti sisään kuultuaan Josephinen kutsun. Ja


äitinsä kehotukseen olemaan huolellinen vastauksissaan
kysyttäessä Josephinen yön viettoa heidän talossaan, vastasi hän
vakavana:

"Luulen, että sitten on parasta mennä riisumaan hevonen."


Ilmeisesti oli hänen aikomuksensa olla tekemättä mitään
kysymyksiä, sillä hän kääntyi lähtemään ulos.

Mrs Whitmanin ääni pysäytti hänet.


"Les on taas pulassa."

"Mitä hän nyt on tehnyt?"

"Miss Hamilton tapasi hänet Triangle L:n tallissa vaikeasti


haavoittuneena. Se tapahtui myöhään eilen illalla. Hän toi Lesin
Lattimerin talolle."

"Lattimerin!" Nuoren jättiläisen silmissä leimahti tuli. Hänen


kiinteän katseensa edessä tunsi Josephine itsensä kiusaantuneeksi.
Oli aivan kuin mies olisi koettanut lukea hänen ajatuksensa ja
huomannut ne häpeällisiksi. Kun Josephine katsoi suoraan häneen,
sammui tuli hänen silmistään ja hänen katseensa muuttui
arvoitukselliseksi ja ystävälliseksi.

"Miksi veitte hänet Lattimerin luo, ma'am?"

"Hän pyysi päästä sinne. Miksi kyselette? Onko mitään syytä,


jonka vuoksi hänen ei olisi pitänyt mennä sinne?"

Hän huomasi äidin ja pojan vaihtavan nopean silmäyksen, mutta


hän ei voinut saada selvää sen merkityksestä, sillä kummankin katse
oli heti muuttunut ilmeettömäksi ja välinpitämättömäksi.

Benin kuunnellessa äänettömänä kertasi Mrs Whitman


Josephinen kertomuksen.

"Luulen, että olette oikeassa", sanoi Ben. "Brannon hirttäisi hänet


tuossa tuokiossa, jos hän tietäisi Lesin olevan Lattimerin luona.
Brannonin kanssa ei sovi leikitellä." Hänen katseensa oli rauhallinen.
"Te sanoitte nähneenne Brannonin ampuvan Callahanin?"
"Niin." Veri nousi Josephinen kasvoille. Hän ei olisi tahtonut
valehdella Mrs Whitmanin läsnäollessa, mutta hän ei saanut antaa
heidän tietää, että Brannon oli tahallaan tappanut Callahanin, sillä
kun Lattimer oli kertonut hänelle, että Brannonin ja Callahanin välillä
oli ollut "pahaa verta" oli hän sielussaan tullut vakuutetuksi siitä, että
Brannonilla oli syynsä murhatekoon ja hän pelkäsi, että ellei hän
pysyisi entisessä kertomuksessaan, niin vaatisivat Starin miehet
kostoa Brannonille. Ja lisäksi tuli vielä Lattimerin varoitus, ettei hän
antaisi kenenkään viekotella itseltään totuutta asiassa.

"Callahan ahdisteli teitä?" kysyi Ben.

"Minähän kerroin sinulle, että hän teki sen, Ben", vastasi Mrs
Whitman
Josephinen puolesta.

Ben raapasi päätään. Hänen katseensa oli hämmentynyt,


huolestunut.

"En saa sitä päähäni, näen mä" sanoi hän, katsoen Josephineen,
"mutta jos kerran sanotte sen, niin sen luonnollisesti täytyy olla
totta." Hän kääntyi ovelle. "Minä vien hevosenne kauemmaksi",
lopetti hän, mennessään ulos.

"Brannon on kova", sanoi Josephine, keskeyttäen äänettömyyden,


joka oli seurannut Benin lähtöä.

"Häntä ei voi taivuttaa, rakkaani, sitä kai tarkoitatte", sanoi Mrs


Whitman lempeästi. "Moni mies on koettanut sitä. Sellaiset miehet
kuin Brannon, ovat ihmeellinen apu tässä laittomuuden maassa.
Heittiötkin varovat joutumasta hänen kanssaan vastatusten. He
tuntevat hänet kaikki mieheksi, jota ei mikään voi peloittaa. He
tietävät, että kun hän kerran antaa sanansa, niin hän sen myös pitää
ja ettei hän peräänny tuumaakaan siitä mitä pitää oikeana. Mutta
hänellä on myös miellyttävä, lempeä puolensa ja hän on
oikeudenmukainen ja erittäin kunniallinen."

Mrs Whitmanin ystävälliset silmät näyttivät etsivän Josephinen


sielun syvimpiä sopukoita. Hän tunsi aivan kuin voimakas valo olisi
kääntynyt niihin. Ja silloin hän punastui.

"Ettekö pidä Brannonista, rakkaani?"

"En", sanoi Josephine lyhyesti. "Se on, minä — minä luulen, että
kunnioitan häntä, luonnollisesti. Mutta hän on ylpeä ja käskevä."

Mrs Whitmanin hymy oli selittämätön. Hän ei vastannut mitään.


Hän näytti kuuntelevan jotakin ulkona tapahtuvaa, katsellessaan
Josephineä.

"Joku tulee", sanoi hän kohta. "Se on varmaankin joku Triangle


L:stä, joka hakee teitä, rakkaani."

Se oli Betty. Hän tuli sisään hyvin kalpeana, tukka tuulen


pieksämänä ja silmät ja nopea hengitys todistivat, että hän oli
sangen kiihoittunut. Kun hän näki Josephinen, joka istui oveen päin,
josta hän juuri oli tullut, hätkähti hän, huokasi syvään ja pannen
kätensä sydämelleen nojasi väsyneenä oven pieleen.

"Armias taivas, Jo, kylläpä säikytit minut!" huudahti hän. "Miksi


ihmeessä teit sillä tavalla?"

Josephine oli noussut seisomaan. Hän oli tuntevinaan, että Bettyn


huoli tällä hetkellä oli hyvin teeskenneltyä, muistaessaan hänen
kylmän jäykkyytensä edellisenä iltana. Ja Josephinen suuttumus,
jota hän matkallaan Lattimerin talosta oli huolellisesti tallettanut,
näkyi selvästi siinä lujassa, hieman vihaisessa katseessa, jonka hän
Bettyyn kohdisti.

"Minä halusin vain ratsastaa hieman. Sitäpaitsi ei Chong vielä ollut


palannut ja tahdoin tietää, miten Mrs Whitman voi."

Betty koetti parhaansa mukaan hymyillä Josephinen sotaiselle


äänensävylle, muistaen kohteliaisuus-velvollisuuttaan vierastaan
kohtaan. Mutta Betty ei osannut teeskennellä, joten hymystä tuli sen
irvikuva.

Hän tunsi itsekin, että se epäonnistui. Ja hän tiesi, että hän oli
oikeutettu vaatimaan oikeudenmukaista kohtelua, vaikka Josephine
olikin hänen vieraansa. Koettaen sitten tukahduttaa suuttumustaan,
hymyili hän iloisesti Mrs Whitmanille ja lausui valittelunsa hänen
sairautensa johdosta.

Sitten hän kääntyi Josephinen puoleen ja nyt hänen hymynsä oli


lempeä, rauhaa tarjoava.

"Olisit sanonut minulle, minne olit menossa, Jo", sanoi hän. "Silloin
en olisi ollut huolissani. Ehkäpä olisin tullut kanssasi. Sinähän olit
täällä koko yön?"

Tahtomattaan katsoi hän Mrs Whitmaniin, ikäänkuin hakien


vahvistusta Josephinen jotenkin ylimalkaiselle päännyökkäykselle.
Josephinen posket kalpenivat vihasta, sillä hän näki Bettyn
katseesta, että hän epäili hänen totuudenrakkauttaan.

"Betty, minä toivon, ettet luule minun kuljeksineen ympäri koko


yön!"
"No mutta, Jo!"

Bettyn posket kävivät tulipunaisiksi. Oli selvää, että Jo oli


päättänyt saada aikaan riitaa, vaikka näkyväistä syytä ei ollutkaan.
Betty oli kyllä tiennyt, että Jolla oli sisua, mutta että hän äkkiä saattoi
tulla hävyttömäksi ilman selvää syytä, se oli eräs puoli hänen
luonteessaan, joka häneltä oli pysynyt salassa.

"Mutta Jo", sanoi hän, "mitä sinä tarkoitat?"

"Luulen, että tiedät, mitä tarkoitan, Betty Lawson", sanoi


Josephine kylmästi. Hänen suuttumuksensa oli kiteytynyt
päätökseksi antaa Bettyn tietää, että hän oli huomannut Bettyn
jäykkyyden edellisenä iltana.

"Sinä tiedät varsin hyvin mitä tarkoitan", jatkoi hän ilkeästi.


"Luuletko, etten huomannut sitä katsetta, jonka minuun loit, kun
kerroin sinulle, että Brannon ja minä olimme olleet kahden
karjatalolla, sillä aikaa kuin Denver ja Chong olivat poissa sieltä? Oh,
älä teeskentele, Betty!" ivasi hän Bettyn hämmentyneen katseen
johdosta. "Sinä olet mustasukkainen jokaiselle, joka vain
puhutteleekin Brannonia! Tuskin katsoit minuun eilen illalla sen
jälkeen kuin kerroin mitä oli tapahtunut. Sinä et edes ollut kohtelias
minulle, vieraallesi."

"Jo!" huudahti Betty ankarasti, kasvot liekehtivinä.

"Minä en lähde takaisin karjatalolle, en tietenkään", selitti


Josephine, ääni kylmän ivallisena. "En ikänäni voisi tuppautua
ihmisten pariin, jotka eivät kaipaa minua — jotka pelkäävät, että
minä —
"Mitä ihmettä, Jo —"

"Minä vakuutan sinulle, että en tahdo Brannonia itselleni", sanoi


Josephine, hymyillen kostonhaluisesti Bettyn ilmeiselle hämmingille
— hämmingille, jonka Josephine luuli johtuvan siitä tiedosta, että
Bettyn salaisuus oli tullut ilmi. "Brannon ei ole niitä miehiä, joitten
kanssa minä olisin halukas kuluttamaan loput elämäni päivistä.
Mutta minä pelastin hänet Cole Meederin käsistä — pelastin hänet
sinulle. Minä valehtelin Mrs Whitmanille. Sinä tiesit, että valehtelin
sinullekin, Betty, sillä sinä otit sen vaivan päällesi, että näytit sen
minulle. Ellen minä olisi valehdellut, olisi Cole Meeder miehineen
hirttänyt Brannonin! Sillä Callahan ei ahdistellut minua! Minä olin
sisällä silloin, kun kuulin laukauksen ja kun avasin oven, makasi
Callahan kuolleena rappusilla, ja Brannon seisoi hänen vieressään
pistooli kädessä!"

Hetkisen, nähdessään Bettyn peittävän kasvonsa käsillään, tunsi


Josephine katumusta myrskyisestä tunnustuksestaan. Mutta
luonnoton mielijohde näytti vallanneen hänet ja hän kohtasi Bettyn
tuskaisen katseen kylmällä välinpitämättömyydellä.

Kun Betty syöksyi ovesta ulos, otti Josephine pari askelta hänen
perässään, mutta pysähtyi ja jäi seisomaan jäykkänä, kalpeana ja
uhmailevana kuunnellen nopeasti poistuvaa kavion kapsetta.

Nyt se oli sanottu eikä kukaan ollut "viekotellut" sitä häneltä "ulos."
Hän oli kokonaan antautunut intohimoisen suuttumuksen valtaan,
joka koko aamun oli kasvanut hänessä sen kautta, että hän oli
alituisesti ajatellut Bettyn puolelta osakseen tullutta luuloteltua
huonoa kohtelua. Mutta hän oli varma siitä, että hän ei olisi sanonut
mitään, ellei hän olisi ollut puolihulluna siitä hermojännityksestä,

You might also like