Instant ebooks textbook (eBook PDF) Java How To Program (Early Objects) 10th download all chapters
Instant ebooks textbook (eBook PDF) Java How To Program (Early Objects) 10th download all chapters
com
https://ebooksecure.com/product/ebook-pdf-java-
how-to-program-early-objects-10th/
http://ebooksecure.com/product/ebook-pdf-java-how-to-program-late-
objects-global-edition-11th-edition/
ebooksecure.com
http://ebooksecure.com/product/ebook-pdf-java-how-to-program-early-
objects-11th-edition-by-paul-j-deitel/
ebooksecure.com
http://ebooksecure.com/product/c-how-to-program-early-objects-
version-9th-edition-ebook-pdf/
ebooksecure.com
https://ebooksecure.com/download/c-how-to-program-an-objects-natural-
approach-11e-ebook-pdf/
ebooksecure.com
(eBook PDF) Translational Medicine in CNS Drug
Development, Volume 29
http://ebooksecure.com/product/ebook-pdf-translational-medicine-in-
cns-drug-development-volume-29/
ebooksecure.com
https://ebooksecure.com/download/progress-in-heterocyclic-chemistry-
ebook-pdf/
ebooksecure.com
http://ebooksecure.com/product/ebook-pdf-c-how-to-program-10th-
edition-by-paul-j-deitel/
ebooksecure.com
http://ebooksecure.com/product/ebook-pdf-big-java-early-objects-5th-
edition/
ebooksecure.com
http://ebooksecure.com/product/ebook-pdf-big-java-early-objects-7th-
edition/
ebooksecure.com
Global Global
edition edition
edition
GlobalJava™ How to Program
For these Global Editions, the editorial team at Pearson has
collaborated with educators across the world to address a
wide range of subjects and requirements, equipping students
Early Objects
with the best possible learning tools. This Global Edition
preserves the cutting-edge approach and pedagogy of the
original, but also features alterations, customization and
adaptation from the North American version.
edition
TENTH
Java™ How to Program
Deitel • Deitel
This is a special edition of an established
title widely used by colleges and universities
throughout the world. Pearson published this
Early Objects
exclusive edition for the benefit of students
outside the United States and Canada. If you TENTH edition
purchased this book within the United States
or Canada you should be aware that it has
been imported without the approval of the
Publisher or Author.
Paul Deitel • Harvey Deitel
Pearson Global Edition
A01_DEIT7806_SE_10_TP.fm Page 6 Monday, July 7, 2014 12:37 PM
Trademarks
DEITEL, the double-thumbs-up bug and DIVE INTO are registered trademarks of Deitel and Associates,
Inc.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks
of their respective owners.
Microsoft and/or its respective suppliers make no representations about the suitability of the information
contained in the documents and related graphics published as part of the services for any purpose. All
such documents and related graphics are provided “as is” without warranty of any kind. Microsoft and/
or its respective suppliers hereby disclaim all warranties and conditions with regard to this information,
including all warranties and conditions of merchantability, whether express, implied or statutory, fitness
for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective sup-
pliers be liable for any special, indirect or consequential damages or any damages whatsoever resulting
from loss of use, data or profits, whether in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of information available from the services.
The documents and related graphics contained herein could include technical inaccuracies or typograph-
ical errors. Changes are periodically added to the information herein. Microsoft and/or its respective sup-
pliers may make improvements and/or changes in the product(s) and/or the program(s) described herein
at any time. Partial screen shots may be viewed in full within the software version specified.
Microsoft® and Windows® are registered trademarks of the Microsoft Corporation in the U.S.A. and
other countries. Screen shots and icons reprinted with permission from the Microsoft Corporation. This
book is not sponsored or endorsed by or affiliated with the Microsoft Corporation.UNIX is a registered
trademark of The Open Group.
Apache is a trademark of The Apache Software Foundation.
CSS and XML are registered trademarks of the World Wide Web Consortium.
Firefox is a registered trademark of the Mozilla Foundation.
Google is a trademark of Google, Inc.
Mac and OS X are trademarks of Apple Inc., registered in the U.S. and other countries.
Linux is a registered trademark of Linus Torvalds. All trademarks are property of their respective owners.
Throughout this book, trademarks are used. Rather than put a trademark symbol in every occurrence of
a trademarked name, we state that we are using the names in an editorial fashion only and to the benefit
of the trademark owner, with no intention of infringement of the trademark.
A02_DEIT7806_SE_10_TOC.fm Page 7 Monday, July 7, 2014 11:59 AM
Contents
Chapters 26–34 and Appendices F–N are PDF documents posted online at the book’s
Companion Website (located at www.pearsonglobaleditions.com/deitel). See the in-
side front cover for information on accessing the Companion Website.
Foreword 23
Preface 25
Before You Begin 39
1 Introduction to Computers, the Internet and Java 43
1.1 Introduction 44
1.2 Hardware and Software 46
1.2.1 Moore’s Law 46
1.2.2 Computer Organization 47
1.3 Data Hierarchy 48
1.4 Machine Languages, Assembly Languages and High-Level Languages 51
1.5 Introduction to Object Technology 52
1.5.1 The Automobile as an Object 52
1.5.2 Methods and Classes 53
1.5.3 Instantiation 53
1.5.4 Reuse 53
1.5.5 Messages and Method Calls 53
1.5.6 Attributes and Instance Variables 53
1.5.7 Encapsulation and Information Hiding 54
1.5.8 Inheritance 54
1.5.9 Interfaces 54
1.5.10 Object-Oriented Analysis and Design (OOAD) 54
1.5.11 The UML (Unified Modeling Language) 55
1.6 Operating Systems 55
1.6.1 Windows—A Proprietary Operating System 55
1.6.2 Linux—An Open-Source Operating System 56
1.6.3 Android 56
1.7 Programming Languages 57
1.8 Java 59
1.9 A Typical Java Development Environment 59
1.10 Test-Driving a Java Application 63
A02_DEIT7806_SE_10_TOC.fm Page 8 Monday, July 7, 2014 11:59 AM
8 Contents
Contents 9
10 Contents
Contents 11
10 Object-Oriented Programming:
Polymorphism and Interfaces 437
10.1 Introduction 438
10.2 Polymorphism Examples 440
10.3 Demonstrating Polymorphic Behavior 441
10.4 Abstract Classes and Methods 443
A02_DEIT7806_SE_10_TOC.fm Page 12 Monday, July 7, 2014 11:59 AM
12 Contents
Contents 13
14 Contents
Contents 15
16 Contents
18 Recursion 818
18.1 Introduction 819
18.2 Recursion Concepts 820
18.3 Example Using Recursion: Factorials 821
18.4 Reimplementing Class FactorialCalculator Using Class BigInteger 823
18.5 Example Using Recursion: Fibonacci Series 825
18.6 Recursion and the Method-Call Stack 828
18.7 Recursion vs. Iteration 829
18.8 Towers of Hanoi 831
18.9 Fractals 833
18.9.1 Koch Curve Fractal 833
18.9.2 (Optional) Case Study: Lo Feather Fractal 834
18.10 Recursive Backtracking 843
18.11 Wrap-Up 844
Contents 17
18 Contents
23 Concurrency 999
23.1 Introduction 1000
23.2 Thread States and Life Cycle 1002
23.2.1 New and Runnable States 1003
23.2.2 Waiting State 1003
23.2.3 Timed Waiting State 1003
23.2.4 Blocked State 1003
23.2.5 Terminated State 1003
23.2.6 Operating-System View of the Runnable State 1004
23.2.7 Thread Priorities and Thread Scheduling 1004
23.2.8 Indefinite Postponement and Deadlock 1005
23.3 Creating and Executing Threads with the Executor Framework 1005
23.4 Thread Synchronization 1009
23.4.1 Immutable Data 1010
23.4.2 Monitors 1010
23.4.3 Unsynchronized Mutable Data Sharing 1011
23.4.4 Synchronized Mutable Data Sharing—Making Operations Atomic 1016
23.5 Producer/Consumer Relationship without Synchronization 1018
23.6 Producer/Consumer Relationship: ArrayBlockingQueue 1026
23.7 (Advanced) Producer/Consumer Relationship with synchronized,
wait, notify and notifyAll 1029
23.8 (Advanced) Producer/Consumer Relationship: Bounded Buffers 1036
23.9 (Advanced) Producer/Consumer Relationship: The Lock and
Condition Interfaces 1044
23.10 Concurrent Collections 1051
23.11 Multithreading with GUI: SwingWorker 1053
23.11.1 Performing Computations in a Worker Thread:
Fibonacci Numbers 1054
23.11.2 Processing Intermediate Results: Sieve of Eratosthenes 1060
23.12 sort and parallelSort Timings with the Java SE 8 Date/Time API 1067
23.13 Java SE 8: Sequential vs. Parallel Streams 1069
23.14 (Advanced) Interfaces Callable and Future 1072
23.15 (Advanced) Fork/Join Framework 1076
23.16 Wrap-Up 1076
A02_DEIT7806_SE_10_TOC.fm Page 19 Monday, July 7, 2014 11:59 AM
Contents 19
20 Contents
Index 1209
Contents 21
Foreword
I’ve been enamored with Java even prior to its 1.0 release in 1995, and have subsequently
been a Java developer, author, speaker, teacher and Oracle Java Technology Ambassador.
In this journey, it has been my privilege to call Paul Deitel a colleague, and to often lever-
age and recommend his Java How To Program book. In its many editions, this book has
proven to be a great text for college and professional courses that I and others have devel-
oped to teach the Java programming language.
One of the qualities that makes this book a great resource is its thorough and insightful
coverage of Java concepts, including those introduced recently in Java SE 8. Another useful
quality is its treatment of concepts and practices essential to effective software development.
As a long-time fan of this book, I’d like to point out some of the features of this tenth
edition about which I’m most excited:
• An ambitious new chapter on Java lambda expressions and streams. This chapter
starts out with a primer on functional programming, introducing Java lambda ex-
pressions and how to use streams to perform functional programming tasks on
collections.
• Although concurrency has been addressed since the first edition of the book, it is
increasingly important because of multi-core architectures. There are timing ex-
amples—using the new Date/Time API classes introduced in Java SE 8—in the
concurrency chapter that show the performance improvements with multi-core
over single-core.
• JavaFX is Java’s GUI/graphics/multimedia technology moving forward, so it is
nice to see a three-chapter treatment of JavaFX in the Deitel live-code pedagogic
style. One of these chapters is in the printed book and the other two are online.
Please join me in congratulating Paul and Harvey Deitel on their latest edition of a won-
derful resource for computer science students and software developers alike!
James L. Weaver
Java Technology Ambassador
Oracle Corporation
Other documents randomly have
different content
All turned their attention to the game. The well thumbed pack
was brought out and given to John to cut. The game progressed
merrily enough for the others, but John was silent. Finally he lost the
game.
“Wine all around,” he muttered hoarsely.
“Here, Maria,” shouted her father to the daughter in the store
proper, “come and give these gentlemen some wine.” They drank the
wine and John flung the marked coin on the counter and started for
the door.
Oh, this raiding business was awful!
But before he had reached the door he heard Manuel shout to his
daughter, “Ajoga o dinheiro.” (Throw away the money.) “The police
are upon us!”
Maria had the coin, which John had paid, in her hand. Just
outside the little back room was a pit covered with boards over
which her father’s horse and wagon were washed. Maria ran out
quickly, dropped the coin between the cracks, and heard the splash
which it made as it touched the water.
She returned and saw an officer examining the cash drawer for
the marked coin.
“Eu digo a verdade,” her father said, “Me no sell wine; me give
mans.”
“You’re a liar,” said the officer testily, for he hated to be beaten in
a raid, “but just the same I’ll have to let you go this time. Look out
for us, however.” And the police left the store amid the jeers and
gibes of the hangers-on at Manuel’s.
“The rascal,” said Manuel to his daughter when all was quiet, “to
try and catch us in a trap like that.”
“Never mind him,” said Maria with a toss of her pretty head. “I
fooled him once tonight and I’ll fool him again. I just promised
Antonio that I’d marry him after the Festa do Espirito Santo.”
A CHANGE OF
OPINION
A CHANGE OF OPINION
I.
f course it happened at the club. Things of this kind
always happen at a club, either because the members
feel freer to discuss the weaker sex when they are not
around, or because some men think a club the only
place for such speeches.
John Harris made the remark, and Walter Andrews, the pet of half
the ladies in the town, was its bitterest opposer.
“I do not believe it,” he said vehemently. “You can not make me
believe it.”
“Nevertheless, my boy, I repeat; no one ever saw or heard of a
really beautiful woman who was good. Mark you, I’m not saying
anything against the merely ‘very pretty girl.’ I’ll admit that there are
some very pretty women who, in addition to their loveliness, are
really good. But these are merely pretty, not beautiful,” Harris
replied.
“What is your standard of ‘goodness’ in a woman, anyway?”
“Well, I’ll admit that my ideal woman would be hard to find. Even
the ‘goodness’ part would be largely above par in a plain, ugly
woman, let alone in a beautiful one. So I’ll take off a few
requirements, and if you can find me a woman who is not a flirt
even in the strictest sense of the word, and who never has been
accused of trying to make a man love her, and, when she has him in
that fix, declare that she only ‘likes him,’ and ‘hopes that they’ll
always be friends’; if you can find such a woman, I’ll—but you can’t.”
The subject was dropped, and shortly after Andrews left the club.
He went home early and to bed, but sleep did not come as it was
wont to. All night long he tossed thinking of what Harris had said,
and wondering where he could find a woman who could come up to
the requirements.
II.
It was a very preoccupied Andrews which entered the office of
“Roberts and Andrews” the next morning, and more than once his
partner asked, “What is the matter with you?”
“Nothing much,” was the invariable response.
Toward afternoon, Mr. Roberts came to him and said, “Andrews,
my niece is coming here to visit us for a while. Can you suggest
anything which would be nice for a young lady of twenty or twenty-
one to do?”
“How’s yachting?”
“The very thing. Funny that we did not think about that. Diana is
very fond of it, she writes. You have a yacht, haven’t you?”
“Yes.”
“What do you call her?”
“The yacht’s name is Diana,” said Andrews, digging his paper-
cutter into the blotter on his desk.
“Queer name that, for a yacht. If I wasn’t positive that I had not
mentioned my niece’s name to you, I would swear that you
christened your boat since I began talking to you. However, I will
have to go back to the house for a while, as I left Diana’s picture at
home and Jones wants to make a cut of it for tomorrow’s Leader. I’ll
be back soon and will show it to you before I take it down.”
The senior partner left the office and Andrews laughed loud and
long. “Positive that he hadn’t mentioned the young lady’s name to
me, was he? Oh, that reminds me that I’ll have to get the name on
the yacht changed.” He reached for the ’phone and after getting into
communication with the man that took care of the boat for him, he
said, “Say, strike off the name and put on Diana.”
Andrews had barely resumed work when Harris came in. “Hello,
old man,” he said in response to Andrews’ greeting, “I dreamed
about you last night.”
“The dickens you did,” replied Andrews, “I dreamed about you.”
“This is getting interesting. What did you dream?”
“I dreamed that I saw the most beautiful woman imaginable
coming toward me with outstretched arms. Just as I was about to
touch her she disappeared, and in her stead, I saw you. You had a
hard, cynical sneer upon your face and you said to me, ‘She is
beautiful, but is she good?’ Yes, she is beautiful, but she is not
good.”
“By Jove, Andrews, my dream was almost exactly like yours. What
can it mean?”
Walter shook his head. “I don’t know,” he said; “but I wish you
hadn’t made such a fool statement.”
Roberts came in just then, and excusing himself, Harris left the
office.
Walter went over to the old man’s desk and watched him as he
slowly took out a large photograph from a mailing envelope.
Andrews gave one glance at it, then with a shriek he flung the
picture to the floor and sank into a chair pale as a sheet. Mr. Roberts
looked at him in blank amazement.
“I am not feeling well,” he explained as he picked up his hat to go
home.
The picture which his partner had shown him was a duplicate of
the face he had seen in his dreams, and which, without doubt, was
the same which his friend had seen.
III.
The train to Mulford slowed down at the station of the little
seaport town and from one of the parlor cars a young woman
stepped out to the platform.
“She was beautiful.” There was no denying the fact. Even the
most unemotional man would have stared long and hard at the
retreating figure once he caught sight of her face.
Anthony Roberts stepped out from the interior of the station and
kissed his niece impulsively.
“Now then, Harris,” said a voice at his ear, “dare you say that that
beautiful woman is not good?”
Harris turned and saw a young member of the club who had been
present when his challenge had been made. “Hello, George, what
woman do you mean?”
“The one walking with old man Roberts.”
Harris looked in the direction which his friend pointed, then
gripped his arm convulsively.
“What the mischief are you gripping me that way for? If all
women affect you this way no wonder you say that no beautiful
woman is good. But, man, you are pale as a ghost. Are you ill?”
“I am not well. Let’s go to the club.”
When they reached their destination, Harris sought a secluded
corner. “Has she come to follow me up and torment me again?” he
thought. “Poor Walter, if he sees her he’ll try to prove that although
she is beautiful, this—” he swallowed hard—“is a good woman. By
God! I’ll let him alone, let him get severely punished and see if he
won’t change his mind a bit. They said that I was to marry her.”
Silently one by one there came to him scenes of what had seemed
like a year in heaven, and following them, came what he had
thought a miniature Hell on earth.
As if from the throat of some unseen person there came the
word, “I can’t marry you John, let us just be friends.”
“I hate you,” he shouted at the top of his voice.
A waiter ran up to the room. “Did you call, sir?”
“Yes, bring me a whiskey.”
Tossing the glass off at one gulp, Harris left the room.
IV.
As Walter was about to open the door to his private office the
sound of girlish laughter floated over the open transom.
“It must be Diana,” he said. Opening the door he stepped into his
office.
“Good morning, Andrews,” said his partner, “allow me.” He took
Andrews’ arm and led him up to the sofa where the young lady of
his dreams was seated.
Andrews bowed his acknowledgment of the introduction. He could
not trust himself to speak. The room was swimming about him and
he seemed to be enveloped in a hazy mist, out of which a woman’s
voice was saying, “I made bold, Mr. Andrews, to come in and
arrange your office; freshen it up a bit, you understand.”
Andrews pulled himself together and looked about him. The usual
staid office was transformed into a flower garden. Flowers were
banked upon each other in a way which bespoke a practised hand.
Roberts and his niece left Andrews’ office and went to the firm’s
waiting rooms.
“What is the matter with your partner?” Diana asked, “he has
such a far away look in his eyes and he seems to be miles away
from the office.”
“Only lately, my dear, only lately. I believe you have had some
thing to do with it.”
“I, Uncle?” Diana gasped in astonishment, “what do you mean? I
never saw him before.”
“Until I showed him your photograph, Andrews was all that one
could ask, but when he saw your picture, he dropped it as suddenly
as if he were holding a hot coal, gave a shriek, and skipped out of
the office. I had intended to ask him what made him act the way he
did, but it passed my mind.”
“I am going to ask him myself.” And Diana started for Andrew’s
office.
“Diana,” called her uncle. But that young lady kept on until she
had reached Andrews’ room. She knocked twice and receiving no
answer, opened the door and walked in. She found Andrews with his
head down upon his arms on his desk. Gently touching him on the
shoulder she said, “Mr. Andrews!”
Walter started up suddenly. “I beg pardon,” he stammered, “but I
did not sleep at all well last night and now I was almost gone. Can I,
and may I, be of any assistance to you?” His old manner had
returned and he was now the Walter Andrews which his partner had
known all his life.
Diana was astonished at the sudden transition which had taken
place and it was her turn to be at a loss for something to say.
“Uncle said you had a yacht,” she finally began.
“Yes,” he replied, “will you be ready to go out with me this
afternoon?”
“I should be delighted to go.”
They were silent for a moment, then Diana said, “Mr. Andrews, I
heard that when you saw my picture you dropped it and gave a
scream of terror. May I ask why?”
Andrews dropped back into the manner which Diana had first
seen him. In a strained tone of voice he said, “Miss Langdon,
someday, but not now, I hope to be able to tell you the reason for
my astonishing behavior.”
“‘Some day, but not now,’” she quoted; “When will that be?”
“When I have known you better,” he said bluntly. “When may I
call for you?”
“I have changed my mind; I am not going.”
“But you promised,” reminded Andrews.
“I do not care if I did,” she returned with some heat as she rose
and left the room.
“‘She is beautiful, but is she good?’” Andrews unconsciously
murmured. “Oh, confound it, will I never forget that dream?”
V.
Towards afternoon Andrews heard a gentle knock on his door.
“Come in,” he said.
Miss Langdon entered dressed in a sailor suit. “You see,” she
explained, “I just realized that a promise is a promise and so I’ve
come to go yachting with you. Can you go now?”
“Can I go?” asked Andrews. “Just watch me.” And giving his desk
cover a pull, he reached for his hat and said, “I’m ready now.”
“It took you less time to get ready than it took me,” she smiled.
Andrews looked admiringly at her costume but said nothing. The
distance to the pier was not long, and today Andrews found it much
shorter than usual. Given, a bright vivacious girl and a man who
appreciates that kind, and it needs no mathematician to prove that
they will make a congenial couple.
The day was delightful. Just the right amount of wind was
blowing for a sail. They talked pleasantly for some time as the big
yacht skimmed over the water like a great white bird. Then Andrews
said, “Miss Langdon, I have a friend who says that all women are
flirts. Is he right?”
“Really Mr. Andrews, you take me at a disadvantage.”
“How so?”
“Why, you ask me either to laud or condemn myself, and you
know that no man can, on trial, be compelled to give testimony
against himself.”
Andrews laughed. “Let’s change the subject. See that school of
red fish?”
“Yes.”
“Well, if we were in Hawaii and these fish came into the harbor
we might expect to hear of the death of a member of the royal
family. The Hawaiians have a superstition that these fish come to
announce the death of a chief. Are you at all superstitious?”
“Well, I believe that thirteen is an unlucky number.”
“Yes?”
“There were thirteen of us in our club and all but five got married
before the club was a year old.”
“What kind of a club; Browning or Shakespeare?”
“Neither. We had vowed solemn vows that we would not marry
until—” she stopped short.
“Why do you stop?” Andrews asked.
“You men say that women can not keep a secret. I guess that you
are right. I came near giving our club secret away.”
They soon landed, and giving Diana in charge of her uncle, who
was at the dock waiting for them, Andrews went to the club.
“Diana,” said her uncle, “what made you go with Andrews after
you said that you would not?”
“Because,” said that young lady, “because I love—sailing.”
VI.
Andrews met Diana quite frequently during the following days.
Their meeting always awoke in Andrews the question, “Will she
stand the test?”
“I can stand this no longer,” he said one day; “I shall have to
settle the matter at once.” He turned to his telephone and calling up
Miss Langdon, asked her if she cared for a sail.
“I’ll be down directly,” she replied, and she soon appeared. They
boarded the yacht in silence. Neither spoke for a while, then
Andrews broke the silence saying, bluntly, “Diana, I love you; I have
always loved you. Will you be my wife?”
Miss Langdon was silent for a moment, then she asked, “Why did
you act the way you did when you saw my picture?”
“Your answer first,” groaned Andrews.
“I cannot give you my answer today. Come to my uncle’s
tomorrow and I will answer then and there. Let’s go back.”
Knowing that it would be useless to argue with her and make her
give him her answer immediately, Andrews turned the yacht and
started for home.
After landing, he took her to her uncle’s and left her at the gate.
She had not asked him to come in, but he had not noticed the
omission.
“One who has never been accused of trying to make a man love
her, and when she has him in that fix, declare that she only likes him
and hopes that they will always be friends,” kept ringing in his ears.
Certain it was that since she had met him Diana had tried to make
him love her. Would she stand the test?
VII.
Andrews did not come to work the day after. “He ’phoned me that
he would not be down until afternoon,” said Roberts, when Harris
called to see his friend. “He is not feeling well. But, Harris, you have
not met my niece. Come this way.” An urgent message intercepted
him as they went to Andrews’ room, and hearing that his niece and
Harris were old acquaintances, Harris was left to renew his
friendship.
Somehow, Harris had not met the young lady since her arrival at
Mulford. He avoided all parties and gatherings which he knew she
was to attend and once he had gone away just as he reached the
door of a friend’s house, because he caught a glimpse of her as she
talked to Walter Andrews.
Harris stopped at the door. Should he go in or should he meet her
and denounce her and her works? He decided on the latter and
knocked at the office. A low voice bade him enter. Closing the door
he turned and saw the beautiful woman reading a book. Looking her
full in the face he said, “Diana.”
“John!” she exclaimed.
“Yes, it is John. Diana, have you changed your mind?” Somehow
the dreadful words which he had planned to utter failed to come and
instead he realized that he loved her, and loved with his whole heart.
Diana was silent. “Then you still do not love me?” he asked.
“I really do not know,” she replied softly.
Harris started for the door.
“John,” she called.
He left the door and flung himself beside her chair.
“I love you,” she said; “I love, love you.”
It was the same old story, the telling of which has never made it
grow out of fashion. He caught her up and kissed her again and
again.
“Won’t Andrews be glad that I am at last to settle down and
marry the most beautiful woman on earth?” he asked playfully.
“I think not,” she answered.
“You think not? Why?”
“Because yesterday he asked me to marry him.”
“What did you tell him?”
“To call this afternoon.”
“Send for him now; don’t keep the poor fellow in suspense.”
A messager was dispatched and Andrews came looking haggard
and wan.
“Your answer?” he asked.
“Mr. Andrews, I sent for you to tell you that I can not marry you. I
love another man. Can’t we just be friends?”
Andrews sank into a chair. “He was right,” Andrews muttered,
“Harris was right. No beautiful woman is good.” Then springing up
he shouted, “‘Let’s be friends,’ did you say? Never! Henceforth my
greatest enemy shall be a beautiful woman.”
A FATAL EXCURSION
A FATAL EXCURSION
hree is a large school in Honolulu, called the Royal
School. It is so named because at one time only
children of royal blood were allowed to attend it. But
that is another story.
Business with the principal took me up there one day, and, while
waiting for him, I sat and talked with the janitor.
The school is on a small hill and the road near it is quite steep.
Trolley cars run up that road and come down with the speed of
lightning.
“Whew!” I could not help exclaiming as one car in particular shot
past us, “if some day an axle should break, more than one person
would get hurt, and badly too.”
“You bet,” replied the janitor. There was a pause, and then he
said, “Anyhow, I never ride in them cars unless I can’t help it. I hate
anything with wheels.”
I smiled, sympathetically, I thought, but I suppose in his
estimation it was a smile of incredulity for he hastened to say, “I
used to be a locomotive fireman, but since the day that Jim got
killed, I’ve had but little use for anything but my legs.”
Scenting a story, I asked, “How was that?”
He bit off a fresh bite of tobacco and then began:
“As I said before, I used to be a locomotive fireman over on
Hawaii. Good job alright, but I couldn’t stand it after Jim died. Jim
was my friend, and a right good fellow he was. His job was night
watchman on the docks, but his health gave way and the doctor told
him the best thing he could do was to go to ’Frisco.
“My run included Kohala—ever been there?”
I shook my head.
“Well, you don’t know what you have missed then. The scenery is
magnificent. I had often talked with Jim concerning the place, and
he was just crazy to go and see for himself. He never had a chance,
though, because he used to sleep all day and work all night. But
when the doctor ordered him to throw up his job, he came to me
and asked me to try and get him a permit to ride on my train. We
were on a freighter, and didn’t carry passengers, so I went up to the
manager, and told him the circumstances. But the manager was
cross that day and of course he said ‘no’; said he’d quit giving
passes to people. I told that to Jim and he was dreadfully
disappointed; told me he wanted to see the place before he went
back to the States. So I went to my engineer and asked him to take
Jim as a brakeman. At first he refused, but I insisted, and while we
were talking, a kanaka woman came up and said that her Joe
wouldn’t be able to work that trip, as he was sick.
“I jumped up and made the engineer promise to take Jim in his
stead. He said ‘yes,’ and I went to tell Jim that he might go, and to
explain his duties to him. We were to leave at six o’clock Sunday
morning, and I left Jim’s house early so as to let him sleep enough
to get up early the next morning.
“Sunday morning came, and, by Jove! I never saw a more
beautiful morning again. The birds were singing most glorious, and
the sun shining through the heavy dew drops, made them look like
so many diamonds.
“Before you get to Kohala, you have to come to a steep, curved
incline. We always whistled for ‘brakes’ when we got there and I had
explained to Jim that when we’d blow three whistles, he was to
apply the brakes. He said he understood and took his seat on a
brake, one of them circular kind that you turn with your hand, you
know. He sat on the last box car, but there were a whole lot of flat
cars back of him.
“We started off; Jim enjoying the air, and I, happy in thinking that
I had been able to give the poor fellow such pleasure. By and by we
came near that curve and the engineer blew the whistle for brakes.
Before we started, Jim seemed to understand the signals, but now
the cars were coming down that hill faster than I had ever seen
them before.
“‘What’s the matter with that brakeman?’ the engineer asked me.
“‘I dunno,’ I said, ‘unless he’s fallen off.’
“‘Maybe that’s it,’ the engineer told me, ‘when we get to the
bottom of this, we’d better see.’ So when we got to the foot of the
hill, he stopped the engine and we walked back.
“It was at the beginning of the curve that we found Jim. Yes, he
had fallen off. Poor fellow; ten flat cars had gone over him, and
there was mighty little left of him. He had been cutting up some
tobacco for his pipe, and we found his pipe and a plug of tobacco
and his knife lying near him. I’ve got the knife at home now.
“When we got back from Kohala, I packed up and came to
Honolulu. I couldn’t stand any more railroading.
“That’s why, I can’t bear cars of any sort. Do you blame me?”
I couldn’t say that I did.
Transcriber’s Note:
Jargon, dialect, obsolete and alternative spellings were left
unchanged. Misspelled words were corrected. Obvious printing
errors, such as backwards, upside down, or partially printed letters
and punctuation, were corrected. Final stops missing at the end of
sentences and abbreviations were added.
“Mary” changed to “Maria”
*** END OF THE PROJECT GUTENBERG EBOOK CUPID AND THE
LAW ***
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.