100% found this document useful (1 vote)
42 views

Building Java Programs - A Back to Basics Approach 5th Edition Stuart Reges all chapter instant download

Approach

Uploaded by

evailosulg95
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
42 views

Building Java Programs - A Back to Basics Approach 5th Edition Stuart Reges all chapter instant download

Approach

Uploaded by

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

Download the full version of the ebook at

https://ebookmass.com

Building Java Programs - A Back to Basics


Approach 5th Edition Stuart Reges

https://ebookmass.com/product/building-java-
programs-a-back-to-basics-approach-5th-edition-
stuart-reges/

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


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Building Java Programs: A Back to Basics Approach 4th


Edition Stuart Reges

https://ebookmass.com/product/building-java-programs-a-back-to-basics-
approach-4th-edition-stuart-reges/

testbankdeal.com

(eBook PDF) Building Java Programs: A Back to Basics


Approach 5th Edition

https://ebookmass.com/product/ebook-pdf-building-java-programs-a-back-
to-basics-approach-5th-edition/

testbankdeal.com

Java: A Beginner's Guide: Create, Compile, and Run Java


Programs Today 9th Edition Herbert Schildt

https://ebookmass.com/product/java-a-beginners-guide-create-compile-
and-run-java-programs-today-9th-edition-herbert-schildt/

testbankdeal.com

Introduction to Programming with Java: A Problem Solving


Approach 3rd Edition John Dean

https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/

testbankdeal.com
College physics : a strategic approach 4th Edition Stuart
Field

https://ebookmass.com/product/college-physics-a-strategic-
approach-4th-edition-stuart-field/

testbankdeal.com

Artificial Intelligence: A Modern Approach 4th Edition


Stuart Russell

https://ebookmass.com/product/artificial-intelligence-a-modern-
approach-4th-edition-stuart-russell/

testbankdeal.com

How to Read a Paper: The Basics of Evidence Based Medicine


5th Edition, (Ebook PDF)

https://ebookmass.com/product/how-to-read-a-paper-the-basics-of-
evidence-based-medicine-5th-edition-ebook-pdf/

testbankdeal.com

A Comprehensive Guide to Sports Physiology and Injury


Management: an Interdisciplinary Approach Stuart Porter

https://ebookmass.com/product/a-comprehensive-guide-to-sports-
physiology-and-injury-management-an-interdisciplinary-approach-stuart-
porter/
testbankdeal.com

Complexity Economics: Building a New Approach to Ancient


Economic History Koenraad Verboven

https://ebookmass.com/product/complexity-economics-building-a-new-
approach-to-ancient-economic-history-koenraad-verboven/

testbankdeal.com
Building Java Programs
A Back to Basics Approach
Fifth Edition

Stuart Reges
University of Washington
Marty Stepp
Stanford University
SVP, Courseware Portfolio Management: Marcia Horton

Portfolio Manager: Matt Goldstein

Portfolio Manager Assistant: Meghan Jacoby

VP, Product Marketing: Roxanne McCarley

Director of Field Marketing: Tim Galligan

Product Marketing Manager: Yvonne Vannatta

Field Marketing Manager: Demetrius Hall

Marketing Assistant: Jon Bryant

Managing Content Producer: Scott Disanno

VP, Production & Digital Studio: Ruth Berry

Project Manager: Lakeside Editorial Services L.L.C.

Senior Specialist, Program Planning and Support: Deidra


Headlee

Cover Design: Jerilyn Bockorick

R&P Manager: Ben Ferrini


R&P Project Manager: Lav Kush Sharma/Integra Publishing
Services, Inc.

Cover Art: Marcell Faber/Shutterstock

Full-Service Project Management: Integra Software Services Pvt.


Ltd.

Composition: Integra Software Services Pvt. Ltd.

Printer/Binder: LSC Communications

Cover Printer: Phoenix Color

Text Font: Monotype

The authors and publisher of this book have used their best efforts in
preparing this book. These efforts include the development,
research, and testing of the theories and programs to determine their
effectiveness. The authors and publisher make no warranty of any
kind, expressed or implied, with regard to these programs or to the
documentation contained in this book. The authors and publisher
shall not be liable in any event for incidental or consequential
damages in connection with, or arising out of, the furnishing,
performance, or use of these programs.

Copyright © 2020, 2017, 2014 and 2011 Pearson Education, Inc. or


its affiliates. All rights reserved. Printed in the United States of
America. This publication is protected by copyright, and permission
should be obtained from the publisher prior to any prohibited
reproduction, storage in a retrieval system, or transmission in any
form or by any means, electronic, mechanical, photocopying,
recording, or otherwise. For information regarding permissions,
request forms and the appropriate contacts within the Pearson
Education Global Rights & Permissions department, please visit
www.pearsonhighed.com/permissions/.

PEARSON, and MyLab Programming are exclusive trademarks in


the U.S. and/or other countries owned by Pearson Education, Inc. or
its affiliates.

Unless otherwise indicated herein, any third-party trademarks that


may appear in this work are the property of their respective owners
and any references to third-party trademarks, logos or other trade
dress are for demonstrative or descriptive purposes only. Such
references are not intended to imply any sponsorship, endorsement,
authorization, or promotion of Pearson's products by the owners of
such marks, or any relationship between the owner and Pearson
Education, Inc. or its affiliates, authors, licensees or distributors.

Library of Congress Cataloging-in-Publication Data

Names: Reges, Stuart, author. | Stepp, Martin, author.

Title: Building Java programs: a back to basics approach / Stuart


Reges, University of Washington, Marty Stepp, Stanford University.
Description: Fifth edition. | Hoboken, New Jersey: Pearson, 2019. |
Includes index.

Identifiers: LCCN 2018050748 | ISBN 9780135471944 | ISBN


013547194X

Subjects: LCSH: Java (Computer program language)

Classification: LCC QA76.73.J38 R447 2019 | DDC 005.13/3—dc23


LC record available at https://lccn.loc.gov/2018050748

1 19

ISBN 10: 0- 13-547194- X

ISBN 13: 978-0-13-547194- 4


Visit https://ebookmass.com
now to explore a rich
collection of eBooks and enjoy
exciting offers!
Preface
The newly revised fifth edition of our Building Java Programs
textbook is designed for use in a two-course introduction to computer
science. We have class-tested it with thousands of undergraduates,
most of whom were not computer science majors, in our CS1-CS2
sequence at the University of Washington. These courses are
experiencing record enrollments, and other schools that have
adopted our textbook report that students are succeeding with our
approach.

Introductory computer science courses are often seen as “killer”


courses with high failure rates. But as Douglas Adams says in The
Hitchhiker’s Guide to the Galaxy, “Don’t panic.” Students can master
this material if they can learn it gradually. Our textbook uses a
layered approach to introduce new syntax and concepts over
multiple chapters.

Our textbook uses an “objects later” approach where programming


fundamentals and procedural decomposition are taught before diving
into object-oriented programming. We have championed this
approach, which we sometimes call “back to basics,” and have seen
through years of experience that a broad range of scientists,
engineers, and others can learn how to program in a procedural
manner. Once we have built a solid foundation of procedural
techniques, we turn to object-oriented programming. By the end of
the course, students will have learned about both styles of
programming.

The Java language is always evolving, and we have made it a point


of focus in recent editions on newer features that have been added
in Java 8 through 10. In the fourth edition we added a new Chapter
19 on Java’s functional programming features introduced in Java
8. In this edition we integrate the JShell tool introduced in Java 9.

New to This Edition


The following are the major changes for our fifth edition:

JShell integration. Java 9 introduced JShell, a utility with an


interactive read-eval-print loop (REPL) that makes it easy to type
Java expressions and immediately see their results. We find
JShell to be a valuable learning tool that allows students to
explore Java concepts without the overhead of creating a
complete program. We introduce JShell in Chapter 2 and
integrate JShell examples in each chapter throughout the text.
Improved Chapter 2 loop coverage. We have added new
sections and figures in Chapter 2 to help students understand
for loops and create tables to find patterns in nested loops. This
new content is based on our interactions with our own students
as they solve programming problems with loops early in our
courses.
Revamped case studies, examples, and other content. We
have rewritten or revised sections of various chapters based on
student and instructor feedback. We have also rewritten the
Chapter 10 (ArrayLists) case study with a new program
focusing on elections and ranked choice voting.
Updated collection syntax and idioms. Recent releases of
Java have introduced new syntax and features related to
collections, such as the <> “diamond operator;” collection
interfaces such as Lists , Sets , and Maps ; and new collection
methods. We have updated our collection Chapters 10 and
11 to discuss these new features, and we use the diamond
operator syntax with collections in the rest of the text.
Expanded self-checks and programming exercises. With
each new edition we add new programming exercises to the end
of each chapter. There are roughly fifty total problems and
exercises per chapter, all of which have been class-tested with
real students and have solutions provided for instructors on our
web site.
New programming projects. Some chapters have received new
programming projects, such as the Chapter 10 ranked choice
ballot project.

Features from Prior Editions


The following features have been retained from previous editions:
Focus on problem solving. Many textbooks focus on language
details when they introduce new constructs. We focus instead on
problem solving. What new problems can be solved with each
construct? What pitfalls are novices likely to encounter along the
way? What are the most common ways to use a new construct?
Emphasis on algorithmic thinking. Our procedural approach
allows us to emphasize algorithmic problem solving: breaking a
large problem into smaller problems, using pseudocode to refine
an algorithm, and grappling with the challenge of expressing a
large program algorithmically.
Layered approach. Programming in Java involves many
concepts that are difficult to learn all at once. Teaching Java to a
novice is like trying to build a house of cards. Each new card has
to be placed carefully. If the process is rushed and you try to
place too many cards at once, the entire structure collapses. We
teach new concepts gradually, layer by layer, allowing students to
expand their understanding at a manageable pace.
Case studies. We end most chapters with a significant case
study that shows students how to develop a complex program in
stages and how to test it as it is being developed. This structure
allows us to demonstrate each new programming construct in a
rich context that can’t be achieved with short code examples.
Several of the case studies were expanded and improved in the
second edition.
Utility as a CS1+CS2 textbook. In recent editions, we added
chapters that extend the coverage of the book to cover all of the
topics from our second course in computer science, making the
book usable for a two-course sequence. Chapters 12 –19
explore recursion, searching and sorting, stacks and queues,
collection implementation, linked lists, binary trees, hash tables,
heaps, and more. Chapter 12 also received a section on
recursive backtracking, a powerful technique for exploring a set
of possibilities for solving problems such as 8 Queens and
Sudoku.

This year also marks the release of our new Building Python
Programs textbook, which brings our “back to basics” approach to
the Python language. In recent years Python has seen a surge in
popularity in introductory computer science classrooms. We have
found that our materials and approach work as well in Python as
they do in Java, and we are pleased to offer the choice of two
languages to instructors and students.

Layers and Dependencies


Many introductory computer science books are language-oriented,
but the early chapters of our book are layered. For example, Java
has many control structures (including for-loops, while-loops, and
if/else-statements), and many books include all of these control
structures in a single chapter. While that might make sense to
someone who already knows how to program, it can be
overwhelming for a novice who is learning how to program. We find
that it is much more effective to spread these control structures into
different chapters so that students learn one structure at a time
rather than trying to learn them all at once.
The following table shows how the layered approach works in the
first six chapters:

Chapters 1 –6 are designed to be worked through in order, with


greater flexibility of study then beginning in Chapter 7 . Chapter
6 may be skipped, although the case study in Chapter 7
involves reading from a file, a topic that is covered in Chapter 6 .

The following is a dependency chart for the book:


Supplements
http://www.buildingjavaprograms.com/

Answers to all self-check problems appear on our web site and are
accessible to anyone. Our web site has the following additional
resources for students:

Online-only supplemental chapters, such as a chapter on


creating Graphical User Interfaces
Source code and data files for all case studies and other
complete program examples
The DrawingPanel class used in the optional graphics
Supplement 3G
Our web site has the following additional resources for teachers:

PowerPoint slides suitable for lectures


Solutions to exercises and programming projects, along with
homework specification documents for many projects
Sample exams and solution keys
Additional lab exercises and programming exercises with
solution keys
Closed lab creation tools to produce lab handouts with the
instructor's choice of problems integrated with the textbook

To access instructor resources, contact us at


[email protected]. The same materials are
also available at http://www.pearsonhighered.com/cs-resources.
To ask other questions related to resources, contact your Pearson
sales representative.

MyLab Programming
MyLab Programming is an online practice and assessment tool that
helps students fully grasp the logic, semantics, and syntax of
programming. Through practice exercises and immediate,
personalized feedback, MyLab Programming improves the
programming competence of beginning students who often struggle
with basic concepts and paradigms of popular high-level
programming languages. A self-study and homework tool, the MyLab
Programming course consists of hundreds of small practice
exercises organized around the structure of this textbook. For
students, the system automatically detects errors in the logic and
syntax of code submissions and offers targeted hints that enable
students to figure out what went wrong, and why. For instructors, a
comprehensive grade book tracks correct and incorrect answers and
stores the code inputted by students for review.

For a full demonstration, to see feedback from instructors and


students, or to adopt MyLab Programming for your course, visit the
following web site: www.pearson.com/mylab/programming

VideoNotes

We have recorded a series of instructional videos to accompany the


textbook. They are available at the following web site:
http://www.pearsonhighered.com/cs-resources

Roughly 3–4 videos are posted for each chapter. An icon in the
margin of the page indicates when a VideoNote is available for a
Visit https://ebookmass.com
now to explore a rich
collection of eBooks and enjoy
exciting offers!
given topic. In each video, we spend 5–15 minutes walking through a
particular concept or problem, talking about the challenges and
methods necessary to solve it. These videos make a good
supplement to the instruction given in lecture classes and in the
textbook. Your new copy of the textbook has an access code that will
allow you to view the videos.

Acknowledgments
First, we would like to thank the many colleagues, students, and
teaching assistants who have used and commented on early drafts
of this text. We could not have written this book without their input.
Special thanks go to Hélène Martin, who pored over early versions of
our first edition chapters to find errors and to identify rough patches
that needed work. We would also like to thank instructor Benson
Limketkai for spending many hours performing a technical proofread
of the second edition.

Second, we would like to thank the talented pool of reviewers who


guided us in the process of creating this textbook:

Greg Anderson, Weber State University


Delroy A. Brinkerhoff, Weber State University
Ed Brunjes, Miramar Community College
Tom Capaul, Eastern Washington University
Tom Cortina, Carnegie Mellon University
Charles Dierbach, Towson University
H.E. Dunsmore, Purdue University
Michael Eckmann, Skidmore College
Mary Anne Egan, Siena College
Leonard J. Garrett, Temple University
Ahmad Ghafarian, North Georgia College & State University
Raj Gill, Anne Arundel Community College
Michael Hostetler, Park University
David Hovemeyer, York College of Pennsylvania
Chenglie Hu, Carroll College
Philip Isenhour, Virginia Polytechnic Institute
Andree Jacobson, University of New Mexico
David C. Kamper, Sr., Northeastern Illinois University
Simon G.M. Koo, University of San Diego
Evan Korth, New York University
Joan Krone, Denison University
John H.E.F. Lasseter, Fairfield University
Eric Matson, Wright State University
Kathryn S. McKinley, University of Texas, Austin
Jerry Mead, Bucknell University
George Medelinskas, Northern Essex Community College
John Neitzke, Truman State University
Dale E. Parson, Kutztown University
Richard E. Pattis, Carnegie Mellon University
Frederick Pratter, Eastern Oregon University
Roger Priebe, University of Texas, Austin
Dehu Qi, Lamar University
John Rager, Amherst College
Amala V.S. Rajan, Middlesex University
Random documents with unrelated
content Scribd suggests to you:
barber as it is. Well, up you goes to see ’er, Joe Tridge, gives me as
a reference, and gets the job temporary. And once you’re in, you
ain’t the man you used to be if anything short of dynamite gets you
out of that job again.”
“But why couldn’t you ’ave recommended me to start with?”
“I didn’t know in time. And, for another thing, she was so set on
getting a pattern of virtue. But when she finds things ’ave gone
wrong, and there’s no time to spare, unless she’s willing to lose
money by it, she won’t be so partic’lar, and she’ll overlook some of
your faults, Joe, if you keeps the rest of ’em dark.”
“You seem pretty sure things are going wrong,” said Mr. Tridge.
“I can feel it in me bones,” returned Mr. Dobb. “Anyway Mrs.
Jackson’s coming in the day after to-morrow to meet this chap at one
hundred and twenty-one, ’Igh Street. Now, I may be at the station
when ’e arrives, and pass the time of day with ’im.”
“I can ’ear the dawn breaking,” observed Mr. Tridge, humorously.
“You’ll tell ’im there’s nothing doing, and say you were sent by ’er to
meet ’im and tell ’im so. And she’ll think ’e never come?”
“Helementary, Joe,” criticized Mr. Dobb. “Most helementary! ’E’d
write to ’er when ’e got back, and then the fat ’ud be out of the frying-
pan and into the fire. No, I mean to fix it so that she’s finished with
’im for good and all two minutes after she’s first set eyes on ’im!”
“And ’ow do you do that?” asked Mr. Lock. “Mesmerism?”
“No, circumstantial hevidence,” returned Mr. Dobb, happily. “There’s
more people comes a cropper over circumstantial hevidence than
over the truth coming out by haccident, and that’s saying a lot!”
He glanced warily about him, and then raised his arms in a gesture
inviting closer heed to his words. Four heads bent over the table;
three pairs of ears listened attentively. From one pair of lips came a
whispered fluency of instruction and explanation. Finally, Mr. Dobb
sat back with simpering pride, and his three companions
unanimously expressed their awed respect for his brain-powers.
Again Mr. Dobb bent forward to add sundry details, promising to
instruct those selected for dramatic roles at a more private
opportunity on the morrow.
Mr. Samuel Clark, flattered by having the star part assigned to him,
promised that he would rehearse on every possible occasion during
the following day. Some twenty-two hours later Mr. Dobb called at
Mr. Clark’s lodgings to see whether he was fulfilling this promise, and
Mr. Clark at once afforded him something in the nature of a dress
rehearsal.
“Puffect!” declared Horace, with enthusiasm. “A born actor couldn’t
do it better, especially when you rolls your eyes up like that. I see it
was blowing a bit fresh when I come along just now, so there’ll be a
nice little ground-swell off the ’arbour-mouth to-morrow. ’Ave you
arranged to ’ave colic to-morrow, like I told you?”
“All fixed up; and I’ve got some one else to look after the ferry for the
day, and I’ve borrowed a small boat, like what you said. And I shall
be waiting where you told me all the morning.”
“That’s the idea!” approved Horace. “And now we’ll just go and see
if Peter Lock remembers all he’s got to say, and then we’ll see if the
clock in the ‘Jolly Sailors’ keeps good time.”
Mr. Horace Dobb was patrolling the platform of Shorehaven railway-
station next morning when the express from London came to a
standstill there.
Of the few passengers that thankfully alighted, the majority were
sailormen. Several women and children made up a goodly share of
the rest of the number. Of the half-dozen residue, five were
gentlemen known to Mr. Dobb by sight or personally. The sixth was
a complete stranger, and Mr. Dobb, with a pious expression of
gratitude for this simplification of his task of identifying Mrs.
Jackson’s expected visitor, at once approached him.
“Are you going straight back to the Town ’All, Mr. Binson?” asked
Horace, innocently.
“I’m afraid you’re making an error,” was the reply. “My name is not
Binson.”
“Mean to tell me you’re not Mr. Binson, our town-clerk of Shore’aven
’ere?” demanded Mr. Dobb, incredulously.
“No, I am not. I am a complete stranger to this town.”
“Well, well,” marvelled Mr. Dobb, “you are the exact image of Mr.
Binson, that’s all I can say.”
“Indeed?” returned the other, with scant interest in the coincidence.
“Well, as I say, I am a perfect stranger here. I should be glad, in fact,
if you would tell me the nearest way to the High Street. I have a
business appointment there.”
“Oh!” said Mr. Dobb, with equal listlessness. “Which end of ’Igh
Street? It makes a difference ’ow you goes from ’ere, according to
which end you want.”
“Number one hundred and twenty-one. It’s a barber’s shop.”
“I know it,” said Mr. Dobb. “Name of Bonner.”
“At present, yes,” conceded the other. “It really belongs to a lady,
though—to Mrs. Jackson. Perhaps you know her?”
“’Eard of ’er, I fancy,” returned Mr. Dobb, cursorily. “Pity you got out
at this station, though. Your nearest would ’ave been the station the
other side of the river. ’Owever, you come along of me, and I’ll see
you on the right road. Shall we just ’ave one gargle before we start?”
“Gargle?” asked the other one, in perplexity.
“Tonic,” elucidated Mr. Dobb. “Drink.”
“Thank you, no,” was the reply. “I am a lifelong abstainer from all
alcoholic drinks.”
“Just as you like,” said Mr. Dobb, readily. “Well, come along with me,
and I’ll take you down to the ferry and get you taken across the river,
and you’ll soon be there.”
“I didn’t know there was another station. I suppose the ferry is the
shortest way? I’m not a good sailor, and—”
Mr. Dobb’s eyes glinted.
“Oh, you’ll be all right!” he declared, and led the other man by
devious paths away from the neighbourhood of the High Street and
down to the harbour. To avoid questions which might be thorny to
answer, Mr. Dobb walked swiftly and a little in advance of his
companion, who, evidently deeming Mr. Dobb something of a
roisterous blade, seemed relieved by this arrangement. Arrived at
the quay, Mr. Dobb perceived the lounging form of Mr. Samuel Clark,
and led the stranger up to him.
“This gent wants you to row ’im over to near the ’Igh Street,
ferryman,” said Mr. Dobb. “Oh, and be as quick over it as you can,”
he added, holding Mr. Clark’s gaze; “because ’e says ’e’s not a very
good sailor.”
“I’ll be as quick as I can,” promised Mr. Clark; “but there’s a pretty
strong tide running, sir, don’t forget.”
“There’s no risk I suppose?” asked the visitor, smiling a little
anxiously.
“Bless you, no, sir,” declared Mr. Clark, cosily. “You’ll be as safe as
’ouses with me!”
With a courteous exchange of compliments, Mr. Dobb parted from
his new acquaintance. A minute later Mr. Clark had begun to convey
his passenger across the river, and Mr. Dobb was returning
homeward with the mien of one whose morning has been well spent.
“The current seems quite strong,” remarked the gentleman from
London.
“It are,” agreed Mr. Clark, straining at his sculls. “The current’s
always pretty strong ’ere when the tide’s running out. Like a mill-
stream sometimes, and the worst of it is that you don’t know it till you
get well out on it.”
“I hope we’ll land at the nearest point opposite.”
“We’ll try to land there,” amended Mr. Clark, gravely. “Matter of fact,
the tide’s stronger to-day than I’ve ever known it before.”
“We seem to be drifting further and further down the river,” observed
the other, now clearly falling prey to nerves. “Do you think it would
be better to turn round and go back?”
“Turn round, sir—with the tide running out?” asked Mr. Clark, in
accents almost scandalized. “Why, we should be capsized for dead,
certain sure, in less than no time. Begging your pardon, sir, but it’s
plain you’re no sailor, to talk like that. No, we can’t turn back.”
“Well, perhaps if you were to—to keep the—the front of the boat
pointed straighter for the bank opposite—”
“I can’t!” stated Mr. Clark. “The tide’s too strong. We must land as
near as we can, that’s all. I never knoo such a tide!” he ended,
pettishly.
“You—you don’t think there’s any chance of being carried out beyond
that lighthouse there at the very end, do you?”
“I ’ope and pray not!” soberly returned Mr. Clark.
He bent to his sculls with the greatest determination. A more
sophisticated passenger might have noticed that the ferryman was
pulling far harder with one arm than the other. The present fare,
however, was engrossed in observing more and more of the
opposite bank slip by.
“I do believe we shall be carried right out to sea!” he said at last, with
the utmost concern.
“Not if I can ’elp it!” denied Mr. Clark, and gave a straining,
spectacular display of oarsmanship.
“We shall be carried out to sea!”
Mr. Clark, shipping his skulls with commendable neatness, stared
owlishly at the passenger for a few moments, and then ejaculated:
“Ooh! Ooh, ah!” with intensity of feeling.
“What is it? Whatever is it?”
“Ooh! Ooh, ah!” repeated Mr. Clark. “It’s my ’eart!” he explained,
hollowly, and made a fearsome rolling of his eyes. “I’ve strained it,
or busted it, or something.”
“But—but we shall be capsized—drowned!”
“I couldn’t row another stroke just now, not to save my life,” groaned
Mr. Clark. “And you mustn’t try to take the oars, not even if you
know ’ow to manage ’em. You’d upset the boat if you tried to change
places with me, and you’d upset it if you tried to row from where
you’re sitting.”
His passenger, abandoning a half-formed intention, sat very still.
“Can’t we shout to the people ashore?” he asked, dismally, as the
little boat swept on past the harbour lighthouse.
“They couldn’t ’ear you,” moaned Mr. Clark.
“I could wave to them!”
“And upset the boat?” asked Mr. Clark, faintly. “She’s very, very easy
upset. The chap what owns this boat never tells ’er ’istory when ’e’s
’iring it out to visitors in the summer.”
“What can we do? What can we do?”
“Do? Why, nothing, except ’ope. We must just let the old boat float
out and trust to luck.”
“But—but—” protested the other, wildly.
“Ooh! Ooh, ah!” bellowed Mr. Clark, in accents of acute anguish, as
the easiest way to foreclose vain conversation.
He sat back, groaning horribly, and rubbing various portions of his
anatomy, a fearful glare in his eyes.
The other man, watching him miserably, took a firm grasp of the seat
as the little craft began to pitch and dance over the turmoil of the
harbour-bar.
“We—we—we—” murmured Mr. Clark, with difficulty.
“We what?” asked the other, eagerly.
“I dunno,” said Mr. Clark, blankly.
There was dire silence. The little boat drifted further and further out,
till it was clear of the harbour, and here the scour of the tide carried it
well away from the roadstead.
Mr. Clark, opening one eye, shrewdly surveyed the locality.
“Just—just remembered,” he said. “We’ve got a anchor ’ere in the
locker—a anchor and any amount of cable. We’ll chuck it over, and
we’ll ride ’ere, as easy as easy, till the tide turns.”
“Don’t you feel strong enough to row us back now?”
“’Ave a ’eart, sir!” begged Mr. Clark, reproachfully. “It ’ud pull my
arms out of their sockets to row against this current. But we’ll be all
right ’ere. Once I get the anchor overboard, like this, we’ll be as safe
as safe.”
“All very well!” fulminated the passenger, recovering a little spirit
when he noted that the anchor had checked further seaward flow.
“But why—”
“Ooh! Ooh, ah!” interrupted Mr. Clark. “For ’eaven’s sake, sir, don’t
go a-hagitating of me. When I ’ave attacks like this, I’m sometimes
liable to fits, and if I ’ave a fit ’ere, over goes the boat, and it’s all up
with both of us!”
“Oh, dear—oh, dear!” wailed the other, subsiding.
“I—I’m going to lie down in the bottom of the boat,” announced Mr.
Clark, wanly. “And if I smokes a pipe that might do me good, by
composing of my nerves.”
He kindled his pipe, and forthwith settled himself very comfortably in
the bottom of the boat. For headrest, he had a pillow he fortunately
happened to have brought with him. By a similar kindness of
chance, he had also provided himself with a thick overcoat, and with
this he now snugly covered himself.
Ensued a bleak period of human silence, accentuated by the lapping
of the water round the boat, and the phantom-like scream of
wheeling sea-birds. The passenger, sitting humped-up in an attitude
of complete dejection, surveyed the prone Mr. Clark and
subconsciously became aware of the gentle, rhythmic fall and rise of
the anchored craft.
“Really, it’s most unfortunate!” he whined, at last. “Most unfor—”
He stopped abruptly; his expression was a blend of alarm and self-
suspicion.
“Dear me!” he muttered. “Oh! I do hope—”
Mr. Clark, stirring, opened one eye sufficiently to see that the
complexion of his companion had passed to a strange olive-green
shade, and that he was holding his palm to his forehead. Mr. Clark
closed his eye again with a warm glow of satisfaction.
Twenty minutes later, Mr. Clark again glanced at his companion.
That gentleman’s complexion was now some shades lighter, though
still green of hue, and he was sitting with his arms hanging limply by
his side. His expression suggested that he had no further interest in
life.
“’Ow are you gettin’ on?” asked Mr. Clark.
The other man, turning a pair of glassy eyes on him, shook his head
dolefully and groaned. Mr. Clark, settling down again in comfort, was
callous enough to smile.
Another half-hour elapsed, with the stout ferryman taking life easily
at the bottom of the boat, and with the passenger gaining inside
information as to the treacherous nature of a small boat when
anchored in deep waters. Then, for the third time, Mr. Clark
appraised the state of his passenger and decided that the time for
convalescence had come.
Heartily remarking that the rest had done him a world of good, he
resumed his seat and began to scull towards the harbour with the
greatest of ease. His passenger, drooping woefully in his place,
evidenced no emotion whatever at this impending termination to his
troubles.
In excellent style Mr. Clark regained the sanctuary of the harbour
and drew near to the quay. Mr. Peter Lock, an alert sentinel there for
some while past, was waiting to greet him.
“Oh, poor fellow!” sympathized Mr. Lock. “He do look ill!”
“You needn’t trouble to feel sorry for ’im, Peter,” said Mr. Clark. “’E’s
in that state ’e don’t know what’s ’appening, or whether it’s ’appening
to ’im or somebody else. Got a bit of a ’eadache, ain’t you, sir?” he
bawled at the passenger.
“Oh!” groaned the sufferer, making feeble gestures with his hands
and showing the yellows of his eyes.
“Oh!” he moaned again, and would have collapsed had not Mr. Clark
passed a supportive arm round him.
“There you are, Peter. How’s that?” said Mr. Clark, with something
of a showman’s pride. “Give me a hand to get ’im out of the boat
and up on to the quay. All O.K., I s’pose?” he added, enigmatically.
Mr. Lock nodded.
“She’s going to ’ave tea with ’Orace’s missis, and she’s there now.
She’s been up to the station twice to see if a Mr. Briblett ’ad arrived,
but there was no trace of ’im.”
“Briblett,” murmured the passenger, dazedly. “That’s my name.
Don’t—oh, don’t bother me! I’m ill—ill!”
“’Orace ’as kept out of ’er way all the time, in case some one might
’ave seen ’im up at the station this morning,” whispered Mr. Lock.
“She might begin to smell a rat before the bomb goes off, if she
starts putting questions to ’im.”
With a certain inconsiderate vigour the two friends half-lifted, half-
dragged Mr. Briblett from the boat and assisted him up the steps to
the quay.
“A drop o’ brandy is the only thing to do this poor gent any good,”
prescribed Mr. Lock, producing a flask.
The stranger, although in a comatose condition, proved true to his
lifelong traditions, and feebly waved the stimulant aside.
“Oh, well,” said Mr. Lock, “if ’e won’t drink it, p’r’aps the smell of it
might do ’im good!”
Thus speaking, he delicately sprinkled Mr. Briblett’s shoulder with a
few drops of the spirit, and then very fraternally shared the
remainder with Mr. Clark.
“And now off we goes!” directed Mr. Lock, and, supported by the two
sailormen, the cadaverous Mr. Briblett tottered forward on two
swerving, unstable legs. Closed were Mr. Briblett’s eyes, and the
expression on his face was one of pained indifference to all
mundane affairs.
By quiet side-streets was Mr. Briblett conducted to the
neighbourhood of the little shop in Fore Street. Rounding a corner,
the trio at last reached that emporium. Mr. Lock remembered to
knock Mr. Briblett’s hat off for him, retrieving it with sundry muddy
adhesions, and replacing it on the sufferer’s head at a rakish angle.
Then the door of Mr. Dobb’s shop flew open, the three lurched over
the threshold, and Mr. Dobb quickly flitted in after them from
nowhere. A moment later Mr. Clark and Mr. Lock were exhaustedly
mopping their foreheads, and their burden, unceremoniously
dumped into a chair, was lolling back in his seat, too indisposed even
for protest at his treatment.
“Good gracious, whatever—” began Horace’s spouse, appearing in
vast surprise at the inner door.
Mr. Lock, perceiving a second female rising from a chair in the back
parlour, began to speak loudly and rapidly.
“We’ve just found this chap lying ’elpless at the corner of the road,”
he stated. “We brought ’im ’ere because ’e said ’e wanted to find a
Mrs. Jackson, sir, and we thought that p’r’aps you might know the
good lady. Though whether she’d care to admit to knowing him, I
shouldn’t like to say, her being a most respectable lady, by all
accounts.”
“’E must ’ave been drinking the ’ole of the day!” observed Mr. Clark,
in tones of righteous contempt. “I see ’im myself go into the ‘Jolly
Sailors,’ and the ‘Blue Lion,’ and the ‘Cutlass and Cannon’.”
“I see ’im myself this morning,” said Horace. “I see him come out of
the station, and I thought ’e looked a pretty queer fish. ’E come
straight out of the station and went into the ‘Railway Inn.’”
“I see ’im leave the ‘Flag and Pennant’ at dinner-time,” contributed
Mr. Lock. “’E left there to go to the ‘Royal George’.”
“Brandy, too!” intoned Mr. Clark, sepulchrally. “You just bend down
and sniff. If you can’t smell brandy, I’ll—”
Mr. Briblett, raising his head with extreme difficulty, partly opened his
eyes.
“Where am I?” he demanded, weakly. “I’m—I’m not at all well! I feel
ill—very ill!”
“So I should think!” concurred Mr. Lock. “And the language he was
using!”
“Said ’e’d backed three winners out of five yesterday, and didn’t care
if it snowed pink!” supplied Mr. Clark.
“Wanted us to ’ave a game of ’apenny nap with ’im on the steps of
the Town Hall,” added Mr. Lock.
“Said ’e’d come down to see about a ’air-dressing business, but it
could go to—but ’e wasn’t going to trouble!” stated Mr. Clark.
As one existing on a plane of complete isolation, the stricken Mr.
Briblett rose unsteadily to his feet. Clutching at the back of his chair,
he swayed delicately a while, and then sat down again.
“I—I’d like to go to sleep,” he announced. “I want to go to sleep! I
want to lie down! Oh, I feel so queer! That boat, drifting out to sea
—”
“Boat—sea!” cried Mr. Clark, readily. “There you are! Delirious, and
no wonder! Raving—raving! What a ’orrible hexample for all right-
minded men!”
There was a little wait. Then Mrs. Jackson, coming out of a sort of
trance, pushed past her hostess and stepped through the doorway of
the back parlour. For three long seconds she stared at Mr. Briblett,
and then, drawing a deep breath, she shrilly began to take the
predominant part in the conversation. . . .
Five minutes later Mr. Dobb, Mr. Clark, and Mr. Lock were standing
some streets away, dazedly fanning their brows.
“’Ow the dooce was I to know?” whispered Mr. Dobb, brokenly. “’Ow
the dooce was I to know the chap would be so punctual as to be too
early for the hexpress and come straight along to see Mrs. Jackson
at ’er ’ome?”
His hearers shook their heads in confession of inability to answer the
question.
“And ’ow the dooce was I to know,” continued Mr. Dobb, bitterly, “that
she’d asked this other chap to come down and ’elp ’er with ’er
business affairs, now ’e’d got back to England after fifteen years in
the Colonies, and never been to Shore’aven before to see ’er? ’Ow
the dooce was I to know? . . . Why, I didn’t even know she’d got a
brother!”
EPISODE IV
BLACK CATS ARE ALWAYS LUCKY

It had been a day thickly veined and marbled with emotions for the
little group of men who, aforetime, had in some measure controlled
the sea-going vagaries of that decrepit old barque, the “Jane
Gladys.” For, that day, the “Jane Gladys” had ceased to be a ship
dowered with an imposing collection of virtues perceptible only to the
auctioneer, and had become but so much old wood and rusting iron
to be exploited by the speculative marine-store dealer who hazarded
the highest price for her unlovely bulk.
This distressful climax in the nautical career of the “Jane Gladys”
was not allowed to go unwitnessed by those who had so long lived
and thrived amid the sinister shadows of her ill-repute as a barque
that was the natural home of venal duplicities. The erstwhile crew of
the “Jane Gladys,” those established confederates in mercenary plot
and counterplot, had rallied to watch the transfer of their stronghold
into alien and unsympathetic ownership, and, in the untroubled
throng about the auctioneer, they stood as figures thrust apart from
their fellow-men by the stern arm of Tragedy.
Captain Peter Dutt was there, his countenance a very show-case of
mournful reminiscence as he gazed upon his late command,
although he had retired ashore on a comfortable pension, and had
already taken to bragging about his extraordinary prowess as an
amateur grower of vegetables. That venerable and corpulent
amphibian, Mr. Samuel Clark, was there, too, having contrived to
evade for a while his present duties as ferryman across Shorehaven
Harbour in order to attend this dismal chapter in the history of the
vessel upon which he had served for so many years. And Mr.
Horace Dobb, who formerly graced the cook’s galley of the doomed
ship, was also in attendance in the great glory of garb which was
explained and justified by the fact that he had married a widow and a
snug second-hand business at one fortunate sweep.
But, as may be inferred, the regrets of Captain Dutt, of Mr. Clark, and
of Mr. Dobb were almost entirely retrospective, for their daily bread
was assured. The future was firm ground for their feet to tread, and
their woeful deportment had therefore merely a sentimental value.
Far more earnest and practical was the grief at the passing of the
“Jane Gladys” of the two remaining members of her old crew, Mr.
Peter Lock and Mr. Joseph Tridge.
Despite the assiduity with which these two gentlemen had of late
pointed out to the great god Luck ways by which he might help them,
that fickle deity had proved himself singularly unresponsive. And this
meant that neither Mr. Lock nor Mr. Tridge had any attractive
prospects to solace them for the loss of their employment on the
“Jane Gladys.”
By personal inquiry they had discovered that no master mariner was
prepared to risk the morale of his crew by importing into the fo’c’sle
anyone who had been even remotely connected with the “Jane
Gladys,” nor was a task ashore obtainable when once they had
mentioned the only references they could give.
True, Mr. Dobb had promised them his favour, but, so far, nothing
had come of it save the abortive attempt to procure employment for
Mr. Tridge as a hairdresser. Not that there was any question as to
Mr. Dobb’s sincerity of purpose, for, in projecting philanthropies for
his two unfortunate shipmates, he was largely considering his own
interests. “Strictly Business!” was the self-chosen motto that
controlled Mr. Dobb’s energies in every direction, and always there
was present in his mind the idea that profitable disposal of stock
from the shop in Fore Street might skilfully be accelerated by the
placing of his old accomplices of the “Jane Gladys” in strategic
situations about the town.
But, apart from securing Mr. Samuel Clark his present job, Mr.
Dobb’s efforts had hitherto been negligible in result, and now, of
those who mourned the end of the “Jane Gladys,” none mourned her
with more genuine feeling or with a greater sense of personal
bereavement than Mr. Lock and Mr. Tridge, for others were only
mourning for memories, while they were mourning a lost home.
Gradually, however, as the day had worn on, they had struggled with
and overcome their melancholy, mounting, indeed in the end to a
flippant hilarity which fitted but incongruously with the gravity of their
prospects.
But this was not till the day was nearing its close. The early
afternoon had been a space of sighs and doleful head-shakings, for,
at the close of the sale, Captain Dutt had led his old subordinates
into the “Turk’s Head,” and here they had all spoken so wistfully and
reverently about the “Jane Gladys” that the landlady had wondered
how one of them could have come back wearing a green and pink tie
from a funeral.
Mr. Horace Dobb, not averse from exhibiting the opulence of his new
sphere in life to his former skipper, competed with that worthy for the
honour of being prime host to the party. It was a challenge which
Captain Dutt’s pride forbade him to refuse, and so round after round
of refreshment was served, till by degrees a brisker mood
descended upon the company.
It was not till past tea-time that the party had begun to break up. Mr.
Clark was the first to leave, having suddenly remembered that he
had faithfully promised to return to the ferry at one o’clock sharp.
And next Mr. Dobb went, pleading the calls of business, and
purchasing a cigar at the bar as he left, with excellent effect. For
Captain Dutt, after silently and disapprovingly considering such an
action on an ex-cook’s part, at last stigmatized it as a kind of
Socialism, and bought Mr. Lock and Mr. Tridge a cigar apiece to re-
establish his prestige.
Soon after, Captain Dutt reluctantly announced that he, too, must
now depart, and Messrs. Tridge and Lock accompanied him to the
nearest draper’s shop, where he sagely selected a bonnet to be
presented to Mrs. Dutt the moment he got home. And when the
skipper, already holding the hat-box before him in a propitiatory
manner, had passed from their sight round a corner, Mr. Tridge and
Mr. Lock looked hard and remindedly at each other, and then made
search in their pockets.
As a result, the one party produced a shilling and five pennies, and
the other party disclosed a florin and a halfpenny; frank and
unabashed confession admitted these coins to be “change” which
the skipper had forgotten to pick up amid the mental distractions of
the afternoon.
Whereupon, congratulating themselves and each other on this
presence of mind in face of opportunity, Mr. Lock and Mr. Tridge had
retired to the tap-room of the “Royal William,” and had there
abundantly developed their policy of drowning dull care.
By now the night was well advanced, and a fevered, reckless
brilliance was illuminating Mr. Lock’s personality, lighting up all those
manifold polite accomplishments of which he was a master. Thus,
he had entertained the company with a series of imitations of bird-
calls, and performed clever feats of legerdemain with corks and
pennies and hats.
Mr. Tridge was in complete eclipse. He had tried hard to be not
ungenial, but his temperament was different from Mr. Lock’s, and
every minute of revelry only found him more and more subdued and
morose. He had struggled against this psychological handicap, even
to the extent of exhibiting to the company four or five styles of
dancing with which he was familiar, but so morose and forbidding
was his countenance as he jigged and gyrated that none dared claim
his attention by offering applause, so that when he sat down again it
was amid complete and discouraging silence.
Mr. Lock, however, shone still more effulgently as the evening
progressed. Knotting his handkerchief into semblance of a doll, he
affected that it was a wife and that he was its husband, and built up
on these premises a highly diverting ventriloquial monologue.
And, after that, he successfully introduced some farmyard mimicry,
and then got well away with card tricks. Appreciative, and even
enthusiastic, were Mr. Lock’s audience, and none was more
enthusiastic or appreciative than the plump, fresh-faced little landlord
of the “Royal William.” Not once, nor twice, but thrice, did he pay
tribute to Mr. Lock’s powers in the medium most gratifying to that
artist, and his flow of hospitality ceased only when a big and stern-
visaged lady came presently and stood behind the bar at his side.
And, thereafter, the licensee of the “Royal William” took, as it were,
but a furtive and subsidiary interest in Mr. Lock’s entertainment;
while the lady eyed the performance with a cold hostility which was
inimical to true art.
And whether it was that Mr. Lock grew a little flustered under her
malign regard, or whether it was that he sought to sting the landlord
into revolt against domestic oppression, the fact remains that he
began to intersperse his card tricks with humorous, but inflammatory,
remarks bearing on the subject of domineering wives and too
submissive husbands.
It is possible that the landlord of the “Royal William” derived
amusement from these sallies. Certainly his eyes gleamed at each
thrust, and more than once he turned away to conceal a grin, but he
was too craven to exhibit open hilarity at Mr. Lock’s satires. The
landlady, however, did not hesitate to betray her feelings in the
matter, and thus it was that, at the tail of an amusing anecdote of
domestic tyranny, Mr. Lock found himself confronted with a stern and
acidulated request to sit down and keep quiet unless he wished to
find himself in trouble.
Mr. Lock, a little nonplussed, glanced at the landlord to enlist his
support. The landlord’s gaze was apologetic but unhelpful. Mr. Lock
looked around among his admirers, but their demeanour had
become absent and constrained. Mr. Lock turned and regarded Mr.
Tridge; Mr. Tridge was wrapped in his own sable meditations.
Pettishly, Mr. Lock flung down the pack of cards and sulked in a
corner.
The landlady, having thus suppressed unwelcome propaganda,
indulged in a tight-lipped smile of triumph, and began a rinsing of
glasses. The hush deepened in the room, developing an
atmosphere which brought Mr. Lock back to remembrance of his
own insecure position in the world, and this was rendered still more
discomforting by what followed. For an amiable gentleman in a
check coat, after twice clearing his throat, sought to re-establish light
conversation, and asked the landlord whether there was yet any
news of Ted.
“I had a letter from him,” answered the landlord, coming out of a sort
of thoughtful trance.
“Thanking you for all the kindnesses you’ve showed him, I lay,”
hazarded the checkered gentleman.
“No,” returned the landlord, slowly. “’E only asked me to send on
after him a pair of boots he’d left behind for mendin’.”
“Fancy bothering about boots!” marvelled the other. “If my uncle
died and left me a greengrocery shop—”
“And a nice little business, too, by all accounts,” struck in an
individual in a mackintosh.
“Ay, by his accounts,” agreed the landlord. “If half he said was true,
he won’t have to do any more billiard-marking and odd-jobbing.”
“Not while the money lasts, at any rate,” said the man in the
mackintosh. “Have you got anyone to take his place yet?”
The landlord, shaking his head, replied that he had not yet found a
successor to Ted. Billiard-markers, he added, were scarce; people
who desired employment as such were, as a rule, of one or two
unsatisfactory classes, knowing either too little or too much.
Mr. Lock, assimilating this talk, lifted his eyes and peered as it were
through the mists of his troubles. Here, obviously, was a vacancy
going, and one which he was well qualified to fill, for his knowledge
of the billiard table was neither elementary nor academic. A post as
a marker and odd-job man at the “Royal William” appealed with
equal force to his temperament and his talents. He could conceive
of no form of employment more compatible with his desires. He
almost groaned with mortification at the thought that he had allowed
a faux pas to ruin his chances of so delectable a situation.
None the less, he determined to make sure that his opportunity was
indeed irrevocably lost, and, to that end, when the landlady had
temporarily quitted the apartment, he sidled up to the host of the
“Royal William,” and put a blunt inquiry to him.
“No chance whatever!” answered that worthy, regretfully shaking his
head.
“You’ll find me just the sort of chap you want,” pleaded Mr. Lock.
“I’ve no doubt of it,” accepted the landlord. “If it was only me what
had the say, you could start to-morrow. I don’t mind admitting
straight to your face that I’ve took to you. You’ve got a civil, well-
bred, amoosin’ way with you. You’d get on like a house afire with the
gents in the billiard-room. But—”
He shook his head again, sighed, and left the ellipsis to carry its own
implication.
“The missis, eh?” said Mr. Lock, sadly.
“The missis,” agreed the landlord.
“I suppose it ’ud be no good my trying to—”
“It ’ud be no good your trying anything!” interrupted the landlord, with
conviction. “You can bet she’s got her knife into you, and you can
bet nothing ’ud please her more than to twist it round like a
corkscrew.”
“Well, if I had a job here,” contended Mr. Lock, “she’d have a lot
more chances to twist it.”
“Look here, I’d give you the job if I dared, but I dare not, and that’s
flat and honest,” said the landlord, earnestly. “I daren’t! See?

You might also like