100% found this document useful (3 votes)
45 views

Instant Download Beginning Java Objects: From Concepts to Code, 3rd edition Jacquie Barker PDF All Chapters

Barker

Uploaded by

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

Instant Download Beginning Java Objects: From Concepts to Code, 3rd edition Jacquie Barker PDF All Chapters

Barker

Uploaded by

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

Get ebook downloads in full at ebookmeta.

com

Beginning Java Objects: From Concepts to Code, 3rd


edition Jacquie Barker

https://ebookmeta.com/product/beginning-java-objects-from-
concepts-to-code-3rd-edition-jacquie-barker/

OR CLICK BUTTON

DOWNLOAD NOW

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


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

Beginning Java Objects: From Concepts to Code, 3rd edition


Jacquie Barker

https://ebookmeta.com/product/beginning-java-objects-from-concepts-to-
code-3rd-edition-jacquie-barker/

ebookmeta.com

Beginning Java 17 Fundamentals Object Oriented Programming


in Java 17 3rd Edition Kishori Sharan

https://ebookmeta.com/product/beginning-java-17-fundamentals-object-
oriented-programming-in-java-17-3rd-edition-kishori-sharan/

ebookmeta.com

Beginning Java 17 Fundamentals: Object-Oriented


Programming in Java 17 3rd Edition Kishori Sharan

https://ebookmeta.com/product/beginning-java-17-fundamentals-object-
oriented-programming-in-java-17-3rd-edition-kishori-sharan-2/

ebookmeta.com

Trust and Betrayal in the Workplace 3rd Edition Michelle


Reina Dennis Reina

https://ebookmeta.com/product/trust-and-betrayal-in-the-workplace-3rd-
edition-michelle-reina-dennis-reina/

ebookmeta.com
Trends in Training 1st Edition Brian J. O'Leary

https://ebookmeta.com/product/trends-in-training-1st-edition-brian-j-
oleary/

ebookmeta.com

The Art of Twitter: Build a Business That Makes You


$100/Day (UPDATED August 2023) Lifemathmoney

https://ebookmeta.com/product/the-art-of-twitter-build-a-business-
that-makes-you-100-day-updated-august-2023-lifemathmoney/

ebookmeta.com

Social Psychology, 15th Edition, Global Edition Nyla R.


Branscombe & Robert A. Baron

https://ebookmeta.com/product/social-psychology-15th-edition-global-
edition-nyla-r-branscombe-robert-a-baron/

ebookmeta.com

Lanzkowsky's Manual of Pediatric Hematology and Oncology


7th Edition Jonathan D. Fish

https://ebookmeta.com/product/lanzkowskys-manual-of-pediatric-
hematology-and-oncology-7th-edition-jonathan-d-fish/

ebookmeta.com

The Rough Guide to the USA The South Travel Guide eBook
1st Edition Rough Guides

https://ebookmeta.com/product/the-rough-guide-to-the-usa-the-south-
travel-guide-ebook-1st-edition-rough-guides/

ebookmeta.com
Her Daddy's Jewel (MC Daddies Book 5) 1st Edition Laylah
Roberts

https://ebookmeta.com/product/her-daddys-jewel-mc-daddies-book-5-1st-
edition-laylah-roberts/

ebookmeta.com
Beginning Java Objects
From Concepts to Code
Third Edition

Jacquie Barker
Beginning Java Objects: From Concepts to Code
Jacquie Barker
Fairfax, VA, USA

ISBN-13 (pbk): 978-1-4842-9059-0 ISBN-13 (electronic): 978-1-4842-9060-6


https://doi.org/10.1007/978-1-4842-9060-6

Copyright © 2023 by Jacquie Barker


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: Laura Berendson
Coordinating Editor: Gryffin Winkler
Cover image designed by Pixabay (www.pixabay.com)
Distributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York Plaza, Suite
4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.
com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner)
is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at https://github.com/Apress/
Beginning-Java-Objects-3e.
Printed on acid-free paper
To my husband, best friend, and love of my life, Steve,
who supports me each and every day in more ways
than he can possibly imagine.
Table of Contents
About the Author���������������������������������������������������������������������������������������������������xvii

About the Technical Reviewer��������������������������������������������������������������������������������xix

Preface�������������������������������������������������������������������������������������������������������������������xxi

Introduction����������������������������������������������������������������������������������������������������������xxiii

Student Registration System (SRS) Case Study��������������������������������������������������xxxv

Part I: The ABCs of Objects����������������������������������������������������������������������������� 1


Chapter 1: Abstraction and Modeling����������������������������������������������������������������������� 3
Simplification Through Abstraction����������������������������������������������������������������������������������������������� 3
Generalization Through Abstraction���������������������������������������������������������������������������������������������� 5
Organizing Abstractions into Classification Hierarchies���������������������������������������������������������� 5
Abstraction as the Basis for Software Development������������������������������������������������������������� 10
Reuse of Abstractions����������������������������������������������������������������������������������������������������������������� 11
Inherent Challenges�������������������������������������������������������������������������������������������������������������������� 13
What Does It Take to Be a Successful Object Modeler?�������������������������������������������������������� 14
Summary������������������������������������������������������������������������������������������������������������������������������������ 17

Chapter 2: Some Java Basics��������������������������������������������������������������������������������� 21


Java Is Architecture Neutral�������������������������������������������������������������������������������������������������������� 22
Anatomy of a Simple Java Program�������������������������������������������������������������������������������������������� 27
Comments����������������������������������������������������������������������������������������������������������������������������� 28
The Class Declaration������������������������������������������������������������������������������������������������������������ 30
The main Method������������������������������������������������������������������������������������������������������������������� 31
Setting Up a Simple Java Development Environment����������������������������������������������������������������� 32

v
Table of Contents

The Mechanics of Java��������������������������������������������������������������������������������������������������������������� 32


Compiling Java Source Code into Bytecode�������������������������������������������������������������������������� 32
Executing Bytecode��������������������������������������������������������������������������������������������������������������� 33
Primitive Types���������������������������������������������������������������������������������������������������������������������������� 34
Variables������������������������������������������������������������������������������������������������������������������������������������� 36
Variable Naming Conventions������������������������������������������������������������������������������������������������ 37
Variable Initialization������������������������������������������������������������������������������������������������������������������� 39
The String Type��������������������������������������������������������������������������������������������������������������������������� 40
Case Sensitivity��������������������������������������������������������������������������������������������������������������������������� 41
Java Expressions������������������������������������������������������������������������������������������������������������������������ 42
Arithmetic Operators������������������������������������������������������������������������������������������������������������� 43
Relational and Logical Operators������������������������������������������������������������������������������������������� 45
Evaluating Expressions and Operator Precedence���������������������������������������������������������������� 46
The Type of an Expression����������������������������������������������������������������������������������������������������� 48
Automatic Type Conversions and Explicit Casting����������������������������������������������������������������������� 48
Loops and Other Flow Control Structures����������������������������������������������������������������������������������� 51
if Statements������������������������������������������������������������������������������������������������������������������������� 52
switch Statements����������������������������������������������������������������������������������������������������������������� 55
for Statements����������������������������������������������������������������������������������������������������������������������� 58
while Statements������������������������������������������������������������������������������������������������������������������ 61
Jump Statements������������������������������������������������������������������������������������������������������������������ 63
Block-Structured Languages and the Scope of a Variable���������������������������������������������������������� 65
Printing to the Console Window�������������������������������������������������������������������������������������������������� 67
print vs. println���������������������������������������������������������������������������������������������������������������������� 69
Escape Sequences���������������������������������������������������������������������������������������������������������������� 71
Elements of Java Style���������������������������������������������������������������������������������������������������������������� 72
Proper Use of Indentation������������������������������������������������������������������������������������������������������ 72
Use Comments Wisely����������������������������������������������������������������������������������������������������������� 76
Placement of Braces������������������������������������������������������������������������������������������������������������� 77
Descriptive Variable Names��������������������������������������������������������������������������������������������������� 78
Summary������������������������������������������������������������������������������������������������������������������������������������ 78

vi
Table of Contents

Chapter 3: Objects and Classes������������������������������������������������������������������������������ 81


Software at Its Simplest�������������������������������������������������������������������������������������������������������������� 81
Functional Decomposition����������������������������������������������������������������������������������������������������� 82
The Object-Oriented Approach���������������������������������������������������������������������������������������������� 85
What Is an Object?���������������������������������������������������������������������������������������������������������������������� 85
State/Data/Attributes������������������������������������������������������������������������������������������������������������� 87
Behavior/Operations/Methods����������������������������������������������������������������������������������������������� 89
What Is a Class?�������������������������������������������������������������������������������������������������������������������������� 91
A Note Regarding Naming Conventions��������������������������������������������������������������������������������� 92
Declaring a Class, Java Style������������������������������������������������������������������������������������������������� 93
Instantiation�������������������������������������������������������������������������������������������������������������������������������� 94
Encapsulation����������������������������������������������������������������������������������������������������������������������������� 96
User-Defined Types and Reference Variables����������������������������������������������������������������������������� 97
Naming Conventions for Reference Variables����������������������������������������������������������������������� 99
Instantiating Objects: A Closer Look������������������������������������������������������������������������������������������ 100
Garbage Collection�������������������������������������������������������������������������������������������������������������� 110
Objects As Attributes����������������������������������������������������������������������������������������������������������������� 111
A Compilation “Trick”: “Stubbing Out” Classes������������������������������������������������������������������� 115
Composition������������������������������������������������������������������������������������������������������������������������� 118
The Advantages of References As Attributes����������������������������������������������������������������������� 120
Three Distinguishing Features of an Object-Oriented Programming Language������������������������ 121
Summary���������������������������������������������������������������������������������������������������������������������������������� 121

Chapter 4: Object Interactions������������������������������������������������������������������������������ 125


Events Drive Object Collaboration��������������������������������������������������������������������������������������������� 126
Declaring Methods�������������������������������������������������������������������������������������������������������������������� 128
Method Headers������������������������������������������������������������������������������������������������������������������ 129
Method Naming Conventions���������������������������������������������������������������������������������������������� 129
Passing Arguments to Methods������������������������������������������������������������������������������������������� 130
Method Return Types����������������������������������������������������������������������������������������������������������� 131
An Analogy��������������������������������������������������������������������������������������������������������������������������� 133

vii
Table of Contents

Method Bodies��������������������������������������������������������������������������������������������������������������������� 134


Features May Be Declared in Any Order������������������������������������������������������������������������������ 135
return Statements��������������������������������������������������������������������������������������������������������������� 136
Methods Implement Business Rules����������������������������������������������������������������������������������������� 141
Objects As the Context for Method Invocation�������������������������������������������������������������������������� 142
Java Expressions, Revisited������������������������������������������������������������������������������������������������ 146
Capturing the Value Returned by a Method������������������������������������������������������������������������� 147
Method Signatures�������������������������������������������������������������������������������������������������������������� 148
Choosing Descriptive Method Names���������������������������������������������������������������������������������� 150
Method Overloading������������������������������������������������������������������������������������������������������������������ 151
Message Passing Between Objects������������������������������������������������������������������������������������������ 153
Delegation��������������������������������������������������������������������������������������������������������������������������������� 156
Obtaining Handles on Objects��������������������������������������������������������������������������������������������������� 157
Objects As Clients and Suppliers���������������������������������������������������������������������������������������������� 162
Information Hiding/Accessibility����������������������������������������������������������������������������������������������� 165
Public Accessibility�������������������������������������������������������������������������������������������������������������� 166
Private Accessibility������������������������������������������������������������������������������������������������������������� 168
Publicizing Services������������������������������������������������������������������������������������������������������������ 169
Method Headers, Revisited�������������������������������������������������������������������������������������������������� 171
Accessing the Features of a Class from Within Its Own Methods��������������������������������������� 171
Accessing Private Features from Client Code��������������������������������������������������������������������������� 176
Declaring Accessor Methods����������������������������������������������������������������������������������������������� 176
Recommended “Get”/“Set” Method Headers���������������������������������������������������������������������� 178
IDE-Generated Get/Set Methods������������������������������������������������������������������������������������������ 182
The “Persistence” of Attribute Values���������������������������������������������������������������������������������� 183
Using Accessor Methods from Client Code�������������������������������������������������������������������������� 183
The Power of Encapsulation Plus Information Hiding��������������������������������������������������������������� 184
Preventing Unauthorized Access to Encapsulated Data������������������������������������������������������ 185
Helping Ensure Data Integrity���������������������������������������������������������������������������������������������� 185
Limiting “Ripple Effects” When Private Features Change��������������������������������������������������� 188
Using Accessor Methods from Within a Class’s Own Methods�������������������������������������������� 191

viii
Table of Contents

Exceptions to the Public/Private Rule��������������������������������������������������������������������������������������� 197


Constructors������������������������������������������������������������������������������������������������������������������������������ 201
Default Constructors������������������������������������������������������������������������������������������������������������ 201
Writing Our Own Explicit Constructors�������������������������������������������������������������������������������� 202
Passing Arguments to Constructors������������������������������������������������������������������������������������ 203
Replacing the Default Parameterless Constructor�������������������������������������������������������������� 205
More Elaborate Constructors����������������������������������������������������������������������������������������������� 206
Overloading Constructors���������������������������������������������������������������������������������������������������� 208
An Important Caveat Regarding the Default Constructor���������������������������������������������������� 210
Using the “this” Keyword to Facilitate Constructor Reuse�������������������������������������������������� 212
Software at Its Simplest, Revisited������������������������������������������������������������������������������������������� 216
Summary���������������������������������������������������������������������������������������������������������������������������������� 218

Chapter 5: Relationships Between Objects����������������������������������������������������������� 223


Associations and Links������������������������������������������������������������������������������������������������������������� 224
Multiplicity��������������������������������������������������������������������������������������������������������������������������� 227
Multiplicity and Links���������������������������������������������������������������������������������������������������������� 229
Aggregation and Composition��������������������������������������������������������������������������������������������������� 232
Inheritance�������������������������������������������������������������������������������������������������������������������������������� 234
Responding to Shifting Requirements with a New Abstraction������������������������������������������� 234
(Inappropriate) Approach #1: Modify the Student Class������������������������������������������������������ 235
(Inappropriate) Approach #2: “Clone” the Student Class to Create a GraduateStudent
Class������������������������������������������������������������������������������������������������������������������������������������ 239
The Proper Approach (#3): Taking Advantage of Inheritance����������������������������������������������� 241
The “is a” Nature of Inheritance������������������������������������������������������������������������������������������ 242
The Benefits of Inheritance������������������������������������������������������������������������������������������������� 246
Class Hierarchies����������������������������������������������������������������������������������������������������������������� 247
The Object Class������������������������������������������������������������������������������������������������������������������ 250
Is Inheritance Really a Relationship?���������������������������������������������������������������������������������� 250
Avoiding “Ripple Effects” in a Class Hierarchy�������������������������������������������������������������������� 251
Rules for Deriving Classes: The “Do’s”�������������������������������������������������������������������������������� 252
Overriding���������������������������������������������������������������������������������������������������������������������������� 252

ix
Table of Contents

Reusing Superclass Behaviors: The “super” Keyword�������������������������������������������������������� 256


Rules for Deriving Classes: The “Don’ts”����������������������������������������������������������������������������� 260
Private Features and Inheritance���������������������������������������������������������������������������������������� 262
Inheritance and Constructors���������������������������������������������������������������������������������������������� 267
A Few Words About Multiple Inheritance����������������������������������������������������������������������������� 275
Three Distinguishing Features of an OOPL, Revisited��������������������������������������������������������������� 280
Summary���������������������������������������������������������������������������������������������������������������������������������� 280

Chapter 6: Collections of Objects������������������������������������������������������������������������� 285


What Are Collections?��������������������������������������������������������������������������������������������������������������� 286
Collections Are Defined by Classes and Must Be Instantiated�������������������������������������������� 286
Collections Organize References to Other Objects�������������������������������������������������������������� 287
Collections Are Encapsulated���������������������������������������������������������������������������������������������� 289
Three Generic Types of Collection��������������������������������������������������������������������������������������������� 290
Ordered Lists����������������������������������������������������������������������������������������������������������������������� 290
Dictionaries������������������������������������������������������������������������������������������������������������������������� 292
Sets������������������������������������������������������������������������������������������������������������������������������������� 293
Arrays As Simple Collections���������������������������������������������������������������������������������������������������� 295
Declaring and Instantiating Arrays�������������������������������������������������������������������������������������� 295
Accessing Individual Array Elements����������������������������������������������������������������������������������� 297
Initializing Array Contents���������������������������������������������������������������������������������������������������� 298
Manipulating Arrays of Objects������������������������������������������������������������������������������������������� 300
A More Sophisticated Type of Collection: The ArrayList Class��������������������������������������������������� 305
Using the ArrayList Class: An Example�������������������������������������������������������������������������������� 306
Import Directives and Packages������������������������������������������������������������������������������������������ 306
The Namespace of a Class�������������������������������������������������������������������������������������������������� 310
User-Defined Packages and the Default Package��������������������������������������������������������������� 313
Generics������������������������������������������������������������������������������������������������������������������������������ 314
ArrayList Features��������������������������������������������������������������������������������������������������������������� 315
Iterating Through ArrayLists������������������������������������������������������������������������������������������������ 318
Copying the Contents of an ArrayList into an Array������������������������������������������������������������� 319
The HashMap Collection Class�������������������������������������������������������������������������������������������������� 321

x
Table of Contents

The TreeMap Class�������������������������������������������������������������������������������������������������������������������� 329


The Same Object Can Be Simultaneously Referenced by Multiple Collections������������������������� 332
Inventing Our Own Collection Types������������������������������������������������������������������������������������������ 334
Approach #1: Designing a New Collection Class from Scratch������������������������������������������ 334
Approach #2: Extending a Predefined Collection Class (MyIntCollection)��������������������������� 335
Approach #3: Encapsulating a Standard Collection (MyIntCollection2)������������������������������� 341
Trade-Offs of Approach #2 vs. Approach #3������������������������������������������������������������������������ 346
Collections As Method Return Types����������������������������������������������������������������������������������������� 348
Collections of Derived Types����������������������������������������������������������������������������������������������������� 350
Revisiting Our Student Class Design����������������������������������������������������������������������������������������� 351
The courseLoad Attribute of Student����������������������������������������������������������������������������������� 352
The transcript Attribute of Student�������������������������������������������������������������������������������������� 352
The transcript Attribute, Take 2�������������������������������������������������������������������������������������������� 356
Our Completed Student Data Structure������������������������������������������������������������������������������� 363
Summary���������������������������������������������������������������������������������������������������������������������������������� 364

Chapter 7: Some Final Object Concepts���������������������������������������������������������������� 367


Polymorphism��������������������������������������������������������������������������������������������������������������������������� 368
Polymorphism Simplifies Code Maintenance���������������������������������������������������������������������� 375
Three Distinguishing Features of an Object-Oriented Programming Language������������������������ 378
The Benefits of User-Defined Types������������������������������������������������������������������������������������� 378
The Benefits of Inheritance������������������������������������������������������������������������������������������������� 379
The Benefits of Polymorphism��������������������������������������������������������������������������������������������� 379
Abstract Classes����������������������������������������������������������������������������������������������������������������������� 380
Implementing Abstract Methods����������������������������������������������������������������������������������������� 385
Abstract Classes and Instantiation�������������������������������������������������������������������������������������� 387
Declaring Reference Variables of Abstract Types���������������������������������������������������������������� 389
An Interesting Twist on Polymorphism�������������������������������������������������������������������������������� 390
Interfaces���������������������������������������������������������������������������������������������������������������������������������� 392
Implementing Interfaces����������������������������������������������������������������������������������������������������� 395
Another Form of the “Is A” Relationship������������������������������������������������������������������������������ 400
Interfaces and Casting��������������������������������������������������������������������������������������������������������� 401

xi
Table of Contents

Implementing Multiple Interfaces���������������������������������������������������������������������������������������� 406


Interfaces and Casting, Revisited���������������������������������������������������������������������������������������� 409
Interfaces and Instantiation������������������������������������������������������������������������������������������������� 410
Interfaces and Polymorphism���������������������������������������������������������������������������������������������� 411
The Importance of Interfaces���������������������������������������������������������������������������������������������� 412
Static Features�������������������������������������������������������������������������������������������������������������������������� 423
Static Variables�������������������������������������������������������������������������������������������������������������������� 423
A Design Improvement: Burying Implementation Details���������������������������������������������������� 428
Static Methods�������������������������������������������������������������������������������������������������������������������� 429
Restrictions on Static Methods�������������������������������������������������������������������������������������������� 430
Utility Classes���������������������������������������������������������������������������������������������������������������������� 432
The final Keyword���������������������������������������������������������������������������������������������������������������� 433
Custom Utility Classes��������������������������������������������������������������������������������������������������������� 437
Summary���������������������������������������������������������������������������������������������������������������������������������� 439

Part II: Object Modeling 101��������������������������������������������������������������������������������� 443

Chapter 8: The Object Modeling Process in a Nutshell����������������������������������������� 445


The “Big Picture” Goal of Object Modeling������������������������������������������������������������������������������� 445
Modeling Methodology = Process + Notation + Tool���������������������������������������������������������� 446
My Recommended Object Modeling Process, in a Nutshell������������������������������������������������������ 451
Thoughts Regarding Object Modeling Software Tools��������������������������������������������������������� 452
A Reminder�������������������������������������������������������������������������������������������������������������������������� 455
Summary���������������������������������������������������������������������������������������������������������������������������������� 455

Chapter 9: Formalizing Requirements Through Use Cases����������������������������������� 457


What Are Use Cases?���������������������������������������������������������������������������������������������������������������� 458
Functional vs. Technical Requirements������������������������������������������������������������������������������� 458
Involving the Users�������������������������������������������������������������������������������������������������������������� 460
Actors���������������������������������������������������������������������������������������������������������������������������������������� 460
Identifying Actors and Determining Their Roles������������������������������������������������������������������ 461
Diagramming a System and Its Actors�������������������������������������������������������������������������������� 463
Specifying Use Cases���������������������������������������������������������������������������������������������������������������� 466

xii
Table of Contents

Matching Up Use Cases with Actors����������������������������������������������������������������������������������������� 468


To Diagram or Not to Diagram?������������������������������������������������������������������������������������������������� 468
Summary���������������������������������������������������������������������������������������������������������������������������������� 470

Chapter 10: Modeling the Static/Data Aspects of the System������������������������������ 473


Identifying Appropriate Classes������������������������������������������������������������������������������������������������ 474
Noun Phrase Analysis���������������������������������������������������������������������������������������������������������� 475
Refining the Candidate Class List���������������������������������������������������������������������������������������� 483
Revisiting the Use Cases����������������������������������������������������������������������������������������������������� 488
Producing a Data Dictionary����������������������������������������������������������������������������������������������������� 491
Determining Associations Between Classes����������������������������������������������������������������������������� 492
Association Matrices����������������������������������������������������������������������������������������������������������� 495
Identifying Attributes����������������������������������������������������������������������������������������������������������������� 498
UML Notation: Modeling the Static Aspects of an Abstraction�������������������������������������������������� 498
Classes, Attributes, and Operations������������������������������������������������������������������������������������� 499
Relationships Between Classes������������������������������������������������������������������������������������������� 503
Reflecting Multiplicity���������������������������������������������������������������������������������������������������������� 511
Object/Instance Diagrams��������������������������������������������������������������������������������������������������������� 516
Associations As Attributes��������������������������������������������������������������������������������������������������������� 518
Information “Flows” Along an Association “Pipeline”��������������������������������������������������������������� 520
“Mixing and Matching” Relationship Notations������������������������������������������������������������������������ 527
Association Classes������������������������������������������������������������������������������������������������������������������ 531
Our “Completed” Student Registration System Class Diagram������������������������������������������������ 534
Metadata����������������������������������������������������������������������������������������������������������������������������������� 543
Summary���������������������������������������������������������������������������������������������������������������������������������� 545

Chapter 11: Modeling the Dynamic/Behavioral Aspects of the System��������������� 547


How Behavior Affects State������������������������������������������������������������������������������������������������������ 548
Events���������������������������������������������������������������������������������������������������������������������������������� 551
Scenarios���������������������������������������������������������������������������������������������������������������������������������� 556
Scenario #1 for the “Register for a Course” Use Case�������������������������������������������������������� 557
Scenario #2 for the “Register for a Course” Use Case�������������������������������������������������������� 559

xiii
Table of Contents

Sequence Diagrams������������������������������������������������������������������������������������������������������������������ 560


Determining Objects and External Actors for Scenario #1�������������������������������������������������� 561
Preparing the Sequence Diagram���������������������������������������������������������������������������������������� 563
Using Sequence Diagrams to Determine Methods������������������������������������������������������������������� 568
Communication Diagrams��������������������������������������������������������������������������������������������������������� 571
Revised SRS Class Diagram������������������������������������������������������������������������������������������������������ 573
Summary���������������������������������������������������������������������������������������������������������������������������������� 575

Chapter 12: Wrapping Up Our Modeling Efforts���������������������������������������������������� 579


Testing the Model���������������������������������������������������������������������������������������������������������������������� 579
Revisiting Requirements����������������������������������������������������������������������������������������������������������� 580
Reusing Models: A Word About Design Patterns����������������������������������������������������������������������� 584
Summary���������������������������������������������������������������������������������������������������������������������������������� 587

Part III: Translating an Object Blueprint into Java Code����������������������������� 589


Chapter 13: A Few More Java Details������������������������������������������������������������������� 591
Java-Specific Terminology�������������������������������������������������������������������������������������������������������� 592
Java Archive (jar) Files�������������������������������������������������������������������������������������������������������������� 593
Creating Jar Files���������������������������������������������������������������������������������������������������������������� 594
Inspecting the Contents of a Jar File����������������������������������������������������������������������������������� 595
Using the Bytecode Contained Within a Jar File������������������������������������������������������������������ 596
Extracting Contents from Jar Files�������������������������������������������������������������������������������������� 597
“Jarring” Entire Directory Hierarchies��������������������������������������������������������������������������������� 597
Javadoc Comments������������������������������������������������������������������������������������������������������������������� 599
The Object Nature of Strings����������������������������������������������������������������������������������������������������� 608
Operations on Strings���������������������������������������������������������������������������������������������������������� 608
Strings Are Immutable��������������������������������������������������������������������������������������������������������� 612
The StringBuffer Class��������������������������������������������������������������������������������������������������������� 616
The StringTokenizer Class��������������������������������������������������������������������������������������������������� 617
Instantiating Strings and the String Literal Pool������������������������������������������������������������������ 620
Testing the Equality of Strings��������������������������������������������������������������������������������������������� 624
Message Chains������������������������������������������������������������������������������������������������������������������������ 626

xiv
Table of Contents

Object Self-Referencing with “this”������������������������������������������������������������������������������������������ 628


Java Exception Handling����������������������������������������������������������������������������������������������������������� 630
The Mechanics of Exception Handling��������������������������������������������������������������������������������� 633
Catching Exceptions������������������������������������������������������������������������������������������������������������ 645
Interpreting Exception Stack Traces������������������������������������������������������������������������������������ 651
The Exception Class Hierarchy�������������������������������������������������������������������������������������������� 654
Catching the Generic Exception Type���������������������������������������������������������������������������������� 658
Compiler Enforcement of Exception Handling��������������������������������������������������������������������� 659
Taking Advantage of the Exception That We’ve Caught������������������������������������������������������� 661
Nesting of Try/Catch Blocks������������������������������������������������������������������������������������������������� 662
User-Defined Exception Types��������������������������������������������������������������������������������������������� 663
Throwing Multiple Types of Exception��������������������������������������������������������������������������������� 668
Enum(eration)s�������������������������������������������������������������������������������������������������������������������������� 668
Providing Input to Command-Line-Driven Programs���������������������������������������������������������������� 678
Accepting Command-Line Arguments: The args Array�������������������������������������������������������� 679
Introducing Custom Command-Line Flags to Control a Program’s Behavior����������������������� 681
Accepting Keyboard Input: The Scanner Class�������������������������������������������������������������������� 687
Using Wrapper Classes for Input Conversion����������������������������������������������������������������������� 689
Features of the Object Class����������������������������������������������������������������������������������������������������� 692
Determining the Class That an Object Belongs To��������������������������������������������������������������� 692
Testing the Equality of Objects�������������������������������������������������������������������������������������������� 694
Overriding the equals Method��������������������������������������������������������������������������������������������� 700
Overriding the toString Method������������������������������������������������������������������������������������������� 704
Static Initializers������������������������������������������������������������������������������������������������������������������ 707
Variable Initialization, Revisited������������������������������������������������������������������������������������������������ 709
Variable Arguments (varargs)���������������������������������������������������������������������������������������������� 712
Summary���������������������������������������������������������������������������������������������������������������������������������� 716

Chapter 14: Transforming the Model into Java Code�������������������������������������������� 719


Suggestions for Getting the Maximum Value from This Chapter���������������������������������������������� 720
The SRS Class Diagram Revisited��������������������������������������������������������������������������������������������� 720
The Person Class (Specifying Abstract Classes)������������������������������������������������������������������ 724

xv
Other documents randomly have
different content
The Project Gutenberg eBook of A moment of
madness, and other stories (vol. 2 of 3)
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: A moment of madness, and other stories (vol. 2 of 3)

Author: Florence Marryat

Release date: January 1, 2024 [eBook #72575]

Language: English

Original publication: London: F. V. White & Co, 1883

Credits: Emmanuel Ackerman and the Online Distributed


Proofreading Team at https://www.pgdp.net (This file was
produced from images generously made available by The
Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK A MOMENT


OF MADNESS, AND OTHER STORIES (VOL. 2 OF 3) ***
A MOMENT OF MADNESS.

A MOMENT OF MADNESS,
AND OTHER STORIES.

BY
FLORENCE MARRYAT,
AUTHOR OF ‘PHYLLIDA,’ ‘FACING THE FOOTLIGHTS,’ ETC., ETC.

IN THREE VOLUMES.

VOL. II.

LONDON: F. V. WHITE & CO.,


31 SOUTHAMPTON STREET, STRAND, W.C.
1883.

[All Rights reserved.]


CHEAP EDITION OF
FLORENCE MARRYAT’S
POPULAR NOVELS.
Crown 8vo, cloth, 3s. 6d.

At all Booksellers in Town and Country, and at all Railway Bookstalls.


MY SISTER THE ACTRESS. By Florence Marryat, Author of
‘A Broken Blossom,’ ‘Phyllida,’ ‘How They Loved Him,’ etc.,
etc.
PHYLLIDA. By Florence Marryat, Author of ‘My Sister the
Actress,’ ‘A Broken Blossom,’ etc., etc., etc.
THE ROOT OF ALL EVIL. By Florence Marryat, Author of
‘Love’s Conflict,’ ‘Phyllida,’ ‘A Broken Blossom,’ etc., etc., etc.
A BROKEN BLOSSOM. By Florence Marryat, Author of
‘Phyllida,’ ‘Facing the Footlights,’ etc., etc.

F. V. White & Co., 31 Southampton Street, Strand.

COLSTON AND SON, PRINTERS, EDINBURGH.


CONTENTS.
PAGE
‘SENT TO HIS DEATH!’—Continued, 1
LOST IN THE MARSHES, 21
THE INVISIBLE TENANTS OF RUSHMERE, 93
AMY’S LOVER, 147
LEOPOLD-FERDINAND, DUC DE BRABANT, 185
LITTLE WHITE SOULS, 211
SENT TO HIS DEATH
(Continued).

I had been dreaming of the ghost, and was conscious in a moment,


and sitting up in bed. Whatever I had thought of Bessie’s tales
before, I believed them now, for I could distinctly hear the low,
gasping breath which follows an inordinate fit of sobbing, drawn
apparently close to us.
‘What time is it?’ I exclaimed.
‘It is just three. I have been listening to it for some time, but did not
like to rouse you till I was sure. Is the door locked?’
‘Yes; but I will unlock it at once,’ I said, springing out of bed.
‘No, no! pray do not,’ cried Bessie, clinging to me. ‘What are you
doing? It might come into the room.’
‘My dear Bessie, if it is a ghost, no locks can keep it out; and if it is
not a ghost, what harm can it do us by entering? Pray be
reasonable. We shall never clear up this mystery if we are not a little
brave!’
I shook her off, and approached the door, whilst she rushed back
to her own bed.
I confess that as I turned the key in the lock I felt very nervous. Do
what we will, it is hard to accustom ourselves to think lightly of
communication with the dead; neither did I relish the idea of a trick
being played us in that lonely house at dead of night. The light was
burning brightly in my room, but as I threw the door open, the
corridor seemed dark and empty. I stood upon the threshold and
looked from right to left. What was that white, tall shadow in the
doorway of the spare room?
I called out, ‘Who are you? What do you want?’ The answer I
received was a quick sob and a rustle. Then I saw an indistinct figure
move down the passage with a hurried step, and disappear
somewhere at the further end.
Shall I confess that for all my boasted strength I had not the
courage to follow it? It was one thing to have stood on the threshold
of my lighted room and addressed the apparition, and another to
venture out into the cold and darkness in pursuit of it. I retreated to
Bessie’s bedroom instead.
‘I have seen it!’ I exclaimed. ‘I believe that you are right, Bessie,
and for the first time in my life I have seen a ghost. I meant to have
followed it; but I really felt I couldn’t. To-morrow night I may have
more courage. But hark! what is that noise? Isn’t it baby crying?’
‘Never mind baby; Mrs Graham will attend to him,’ said Bessie.
‘Lock the door again, Dolly dear, do, and get into bed with me, or I
sha’n’t sleep another wink to-night. I’m shaking from head to foot as
it is.’
But the cries from baby’s room became more distinct; and my
courage had returned to me.
‘Let me go and see what is the matter with little Dick first,’ I said,
taking up the lighted candle.
Bessie yelled at being kept alone in the dark, but I could not have
lain down again without ascertaining what ailed the little fellow; so,
disregarding her remonstrances, I walked off to Mrs Graham’s room.
Her door was unlocked, and I entered without knocking.
The child was still crying lustily; and what was my surprise to find
his nurse, utterly regardless of the noise, sitting up in bed, with
scared wide-open eyes, talking vehemently.
‘Go away!’ she was exclaiming in a loud voice; ‘Go away! and
don’t come back again. You let the water in each time you open the
door: I tell you we don’t want you! Go away, I say, and don’t come
back again!’
She halted for a moment at this juncture, and I was about to
waken her from what I perceived was a nightmare, when she
suddenly clapped her hands before her eyes and screamed.
‘Ah, Heavens! a wave—a fearful wave that covers the deck—that
covers everything. Where is he? Where is he gone to? I have sent
him to his death! Edward! Edward! come back to me! I didn’t mean it
—I didn’t mean it! Ah! Lord have pity on me.’
Her agitation was rising so rapidly, and the baby was crying so
violently, that I thought it time to interfere.
‘Mrs Graham!’ I exclaimed, shaking her by the arm, ‘wake up.
Don’t you hear the baby wants you?’
She turned her big eyes upon me in such a pitiful vacuous way.
Then she recognised me, and looked frightened.
‘Have I been dreaming? Have I been saying anything? Oh! I am so
sorry,’ she said apologetically, as she caught up the child and held it
to her breast.
‘You have only been talking a little in your sleep,’ I replied
soothingly; ‘don’t be alarmed; you said nothing out of the common
way, and there is no one here but myself.’
She did not answer, but as she held the child I saw how her arms
trembled.
‘Your agitation is the worst thing possible for the baby, you know;
and you must try and calm yourself for his sake,’ I continued.
‘I should be so sorry to hurt him,’ she murmured; ‘and I will try and
not dream again, if it is possible.’
‘Shall I fetch you anything?’
‘Oh no, madam, thank you. The best thing I can do is to go to
sleep again. There is nothing for me but sleep—and prayer,’ she
added in a whisper.
I felt deeply interested in this young woman. There was an air of
patient mournfulness about her that betokened deep suffering; and
as I returned to my room I resolved to do my best to be of use to her.
She so completely occupied my thoughts, indeed, that I had
forgotten all about the ghost, till Bessie asked me how I could
possibly walk through the corridor with so composed a step.
‘My dear, I was thinking about baby and his nurse, and quite forgot
to be frightened. Yes, they are all right now, and going to sleep again
comfortably; and I think the ghost must have followed their example,
for certainly there were no signs of its presence as I returned: so I
think we had better try to make up for our broken rest by a few hours’
sleep.’
Bessie was quite ready to do so; but for my own part I lay awake
until the loitering dawn broke through the shuttered windows.
Mr Maclean’s absence was really, I found, not to be prolonged
beyond the two nights; so I could write Dick word to fetch me home
on the following day; but I resolved, before I went, to have some sort
of explanatory conversation with Mrs Graham, with respect to her
dream of the night before. I told nothing of it to Bessie; for I felt she
would spoil everything perhaps by her awkwardness in handling the
subject, or wound the poor girl’s feelings by too abrupt a reference to
her grief. But I watched Mrs Graham leave the house at about
eleven o’clock to take her little charge out for his morning walk, and
as soon as Bessie descended to the kitchen quarters to give her
orders for the day, I put on my bonnet and shawl and ran after the
nurse. There was a cold wind blowing from the north, and I knew I
should find her in the sheltered shrubbery, where she had been told
to take the child. It extended for some distance, and when I came up
with her we were quite out of sight and hearing of the house.
‘A fine cold morning!’ I remarked, by way of a beginning.
‘Very cold, madam.’
‘With the wind in the north. A nasty day for the sea—I pity the
ships in the channel.’
To this she made no response.
‘Have you ever been on the sea, Mrs Graham?’
‘Yes! once!’ with a shudder.
‘And did you like it?’
‘Like it? Oh! for God’s sake, madam, don’t speak of it, for I cannot
bear the thought even.’
‘You were unfortunate, perhaps? You had experience of a storm?
But the sea is not always rough, Mrs Graham.’
She was silent, and I looked in her face, and saw the tears
streaming down it.
‘My dear girl,’ I said, placing my hand on her shoulder, ‘don’t think
me unkind. I have guessed somewhat of your history, and I feel for
you—oh, so deeply. Confide in me; my husband is a man of
influence, and I may be of use to you. I see that you are superior to
the position you hold, and I have conceived an interest in you. Don’t
keep your sorrows locked in your own breast, or they will eat out
your very heart and life.’
As I spoke she began to sob piteously.
‘You are not doing right by this poor little baby, nor his parents,’ I
continued, ‘by brooding over a silent grief. You will injure his health,
when perhaps if you will tell us all, we may be able to comfort you.’
‘No one can comfort me, madam! I am beyond all relief.’
‘No one dare say that in this world, which God rules according to
His will. You cannot tell what solace He may hold in the future for
you.’
‘I have no future,’ she said sadly. ‘If you think I am likely to injure
this little one,’ pressing it tightly to her bosom, ‘I am very, very sorry;
but to have something to love and care for, seemed to be the only
thing to prevent my going mad.’
‘Mrs Graham, I don’t wish to be impertinently curious, but I want to
hear your story. Won’t you tell it to me?’
‘If you do, you will hate me—as I hate myself.’
‘I hardly think that possible. Of what crime can you be guilty, to
accuse yourself so bitterly.’
‘I am a murderess!’
She brought out the words so vehemently that I started. Was it
possible she spoke the truth? And yet I had seen in our gaol, such
young and superior-looking criminals, that I knew it might be
possible. My thoughts flew at once to her child.
‘Was it the baby?’ I cried. ‘Oh! my poor child! what drove you to
such an awful deed?’
‘Do you pity me still?’
‘I pity you with all my heart.’
‘Ah! madam; you are too good.’
She trembled so violently that I had taken the child from her arms,
and as I stood there in the wintry path, she sank down upon her
knees before me and kissed the border of my shawl, and hid her
face in it and cried.
‘Mrs Graham, I cannot believe it!’
‘No! you need not believe it. In that sense I did not kill my child.
God took it away from me in anger; but I sent its father, my dearly-
loved husband, to his death.’
‘Sent him to his death!’
‘Ah, madam! have pity on me and listen. We had been married but
six months, and we loved each other, ah! so dearly. He was a clerk
in a city firm, and his employers sent him over to Ireland on
business. We could not bear to part—we went together. In order to
return to England we embarked in a small sailing vessel, and we had
a fearful storm in crossing. The sea ran mountains high, and the
women on board were assembled together in a deck cabin. The men
to whom they belonged kept looking in every now and then to tell
them how we were getting on, and every time the door of the cabin
was opened, the sea rushed in and wetted them. They grew
impatient, I the most of all; and when my dear husband, in his
anxiety lest I should be frightened at our danger, put his head in for
the third or fourth time I called out, saying, ‘Go away, Edward, and
don’t come back again.’ And he went away, and he never did come
back. Ah, Heaven! have mercy upon me!’
‘My poor girl! how did it happen?’
‘He was washed off the deck, madam, by a huge wave that nearly
swamped the ship—so they told me afterwards. But I never saw him
more! The glimpse I had of his bonnie face as it was thrust in at the
half-opened door, beaming with love and anxiety, was the last
glimpse I was ever to have in this world—and I sent him to his death.
I said, ‘Go away, and don’t come back’—and he never came back!—
he never came back!’
Her grief was so violent I almost thought she would have swooned
at my feet. I tried to direct her thoughts in another direction.
‘Have you no friends to go to, Mrs Graham?’
‘None of my own, madam. I was a soldier’s orphan from the Home
when Edward married me. And I could not go to his.’
‘How did you lose your baby?’
‘It died of my grief, I suppose; it only lived a few days. And then
they advised me at the hospital to get a situation as wet nurse; and I
thought the care of an infant might soothe me a little. But my sorrow
is past cure.’
‘You have bad dreams at night, I fear.’
‘Oh! such awful dreams! He is always calling me—calling me to go
to him, and I can find him nowhere; or else I am in the ship again,
and see that which I never did see—the cruel wave that washed him
from me!’
‘Do you feel strong enough to take the child again?’
She had risen by this time, and was, comparatively speaking,
calm. She held out her arms mechanically. I put the baby in them,
and then stooped and kissed her swollen eyes and burning
forehead.
‘I will not discuss this subject with you further to-day,’ I said; ‘but
you have found a friend. Go on with your walk, child, and may God
comfort you. I am glad you have told me the story of your grief.’
I hurried back to Bessie, fearful lest she might come in search of
me, and insist upon hearing the reason of Mrs Graham’s tears.
There was no doubt of one thing—another nurse must be found as
soon as possible for little Dick, and I must take on myself the
responsibility of providing for his present one. But all that required
my husband’s permission and advice, and I must wait till I had seen
and confided in him.
Bessie, who had discovered that, notwithstanding my deplorable
deficiency in the way of children, I could cut out their garments far
better than she could do herself, had provided a delightful
entertainment for me in the shape of half-a-dozen frocks to be made
ready for the nurse’s hands, and the whole afternoon was spent in
snipping and piecing and tacking together. But I didn’t grumble; my
mind was too much occupied with poor Mrs Graham and her pathetic
story. I thought of it so much that the temporary fear evoked by the
apparition of the night before had totally evaporated. In the presence
of a real, substantial human grief, we can hardly spare time for
imaginary horrors.
As bed-time recurred, and Bessie and I locked ourselves into our
stronghold, I refused the half of the bed she offered me, and
preferred to retain my own. I even made up my mind, if possible, not
to sleep, but to watch for the mysterious sounds, and be the first to
investigate them. So I would not put out my candle, but lay in bed
reading long after Bessie’s snores had announced her departure to
the land of dreams.
I had come to the end of my book, my candle, and my patience,
and was just about to give up the vigil as a failure, when I heard
footsteps distinctly sounding along the corridor. I was out of bed in a
moment, with my hand upon the lock of the door. I waited till the
steps had passed my room, and then I turned the key and looked
gently out. The same white figure I had seen the night before was
standing a little beyond me, its course arrested, as it would appear,
by the slight sound of unlocking the door.
‘Now or never,’ I thought to myself. ‘Dick always says I am the
bravest woman he ever met, and I will try and prove him true. Why
should I be afraid? Even if this is a spirit, God is over it and us,
alike!’
So I stepped out into the passage, just as I should sit down to
have a tooth drawn. The figure had recommenced walking, and was
some paces farther from me. I followed it, saying softly, ‘What are
you? Speak to me.’ But it did not turn, but went on, clasping its
hands, and talking rapidly to itself.
A sudden thought flashed across my mind. In a moment I felt sure
that I was right, and had solved the mystery of Poplar Farm. I placed
myself full in the path of the apparition, and as the end of the corridor
forced it to turn and retrace its steps, I met face to face my poor,
pretty Mrs Graham, with the flaxen hair she usually kept concealed
beneath her widow’s cap, streaming over her shoulders and giving
her a most weird and unearthly appearance.
‘Edward! Edward!’ she was whispering in a feverish, uncertain
manner, ‘where are you? It is so dark here and so cold. Put out your
hand and lead me. I want to come to you, darling; I want to come to
you.’
I stretched out my own hand and took hers. She clung to me
joyfully.
‘Is it you?’ she exclaimed, in the undisturbed voice of a sleep-
walker. ‘Have I found you again? Oh, Edward! I have been trying to
find you for so long—so long, and I thought we were parted for ever.’
I drew her gently along to her own room and put her in her bed,
whilst she continued to talk to me in the fond, low tones in which she
thought she was addressing her dead husband.
Bessie slept through it all.
Of course I told her all about it next day, and equally, of course,
she did not believe half what I said. She did not like the idea of
parting with her cherished grievance in the shape of the ghost, nor
having the trouble of changing her wet nurse. So I left her, as soon
as ever Dick arrived, rather disgusted with the manner in which she
had received my efforts for her good, but still determined to do what I
could in the way of befriending Mrs Graham. As I told her the last
thing, when I ran up to the nursery to say good-bye to little Dick, and
received her grateful thanks in reply. ‘Only nothing,’ she said with a
deep sigh, ‘could ever do her any good in this world again.’
‘But I’m determined to get her out of Poplar Farm,’ I said to Dick,
as we drove homeward, after I had told him this long-winded story.
‘She’s killing the baby and herself too. She ought to have a much
more cheerful home and active employment. Now, can’t you think of
something for her to do about the gaol or the hospital, like a dear,
darling old boy as you are?’
‘Well, I don’t quite see how you can take Mrs Maclean’s servant
away from her against her will, Dolly. If Mrs Graham leaves, it will be
a different thing; but as things are, I’m afraid you ought not to
interfere.’
I called him a wretch; but I knew he was right for all that, and
determined to take his advice and wait patiently to see how things
turned out. And, as it happened, I had not long to wait, for a week
afterwards I received this doleful epistle from Bessie:—

‘My dear Dolly,—I am perfectly miserable; nothing ever


goes right with me. Tom threw Charlie out of the wheel-barrow
yesterday, and cut his forehead right across. He will be
scarred for life. And nurse has entirely spoiled those frocks
you were so kind as to cut out for Lily and Bessie. She is so
obstinate, she would have her own way, and the children
positively cannot get into them. But the worst news of all is,
that Mrs Graham is going to leave me, and I have had to
wean baby, and put him on the bottle.’
‘Hurrah!’ I cried, ‘it’s all right. I shall get that poor child here after
all, and be able to patch up her broken life. No, I sha’n’t, though,’ I
continued, as I went on reading, and then, to my husband’s
astonishment, I fell on his neck, and burst into tears. ‘Oh, Dick, Dick,
Dick, I am so glad!’
‘Halloa! what’s up now?’ said that vulgar Dick, in his own way of
expressing things.
‘My darling, she’s got him again.’
‘Who’s got which?’
‘Mrs Graham’s husband has returned. He wasn’t drowned, but let
me finish the letter,’ and drying my eyes I went on—

‘Just imagine how awkward and unpleasant for me. The


other evening there was an awful screaming in the kitchen,
and when I went down, I found Mrs Graham fainted dead
away in the arms of a man. I was very angry at first, naturally;
but when she recovered I found it was her husband whom
she thought was drowned at sea three months ago. It seems
he was picked up insensible by some ship, and taken to
Spain, where he had a fever, and was delirious, and all that
sort of thing; and when he recovered, he worked his way
home before the mast, and had only just found out where his
wife lived. But I think it is excessively unreasonable of people
to take situations, and say they’re widows, and then—’

‘Oh, don’t read any more of that rubbish, for heaven’s sake!’ said
Dick, irreverently. ‘The long and the short of the matter is, that the
girl’s got her man again.’
‘Oh! I am so thankful!’ I exclaimed, with the tears still in my eyes; I
couldn’t help it, they would come. ‘Poor child! poor, desolate, heart-
broken child! What a heaven earth must appear to her to-day. Dick,
will you drive me over to the farm directly after breakfast? I want to
see her and congratulate her.’
‘You seem to take a vast interest in this Mrs Graham, and her joys
and sorrows,’ said Dick; ‘why is it, Dolly?’
‘Because I can sympathise with them so deeply. Because—
because—oh, Dick, you know—because God has given me—you,
and I am the very happiest woman in all the world.’
THE END.
LOST IN THE MARSHES.
On the east coast of the county of Norfolk, there lay a village which
shall be distinguished by the name of Corston. It was bounded on
the one side by the sea, on the other by the open country, and
beside the two or three gentleman farmers whose possessions
comprised all the agricultural land within a radius of five miles, it
could boast of a church and resident parson—a coastguard with its
attendant officer, and above all, close contiguity with Rooklands, the
estate of the Earl of Worcester. And those who are acquainted with
the moral and social aspect, as it existed forty or fifty years ago, of
the more insignificant villages of Norfolk, will acknowledge that
Corston was favoured above its fellows. The sea coast in its vicinity
brought many a gay riding party over from Rooklands, either to enjoy
the fresh breezes, or to bathe in the sparkling waves from some
sequestered nook, whilst the congregation of the church was made
up of drafts from some four or five outlying hamlets which had not
the advantage of a place of worship of their own. Conceive then
what a much larger audience the Corston parson could depend
upon, when the women had a prospect of seeing the bonnets from
ten miles round (to say nothing of a chance of the Rookland
aristocrats taking it into their heads to drive out), in addition to
listening to his somewhat uninteresting sermons. The coastguard,
too, was a cause of constant excitement, on account of the Admiralty
having been in the habit of bestowing the appointment on old, worn-
out, half-pay lieutenants who chose to expire almost as soon as they
obtained it, and really, notwithstanding the church and the parson

You might also like