[Ebooks PDF] download Java Programming Exercises Volume One Language Fundamentals and Core Concepts 1st Edition Christian Ullenboom full chapters
[Ebooks PDF] download Java Programming Exercises Volume One Language Fundamentals and Core Concepts 1st Edition Christian Ullenboom full chapters
com
https://ebookname.com/product/java-programming-exercises-
volume-one-language-fundamentals-and-core-concepts-1st-
edition-christian-ullenboom/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/programming-language-design-
concepts-1st-edition-findlay/
ebookname.com
https://ebookname.com/product/effective-java-programming-language-
guide-1st-edition-joshua-bloch/
ebookname.com
https://ebookname.com/product/java-programming-comprehensive-concepts-
and-techniques-3rd-edition-gary-b-shelly/
ebookname.com
https://ebookname.com/product/blood-noir-anita-blake-vampire-
hunter-16-1st-edition-laurell-k-hamilton/
ebookname.com
Surgical Anatomy and Techniques to the Spine 2nd Edition
Daniel H. Kim Et Al.
https://ebookname.com/product/surgical-anatomy-and-techniques-to-the-
spine-2nd-edition-daniel-h-kim-et-al/
ebookname.com
https://ebookname.com/product/multicultural-psychology-6th-edition-
jeffery-scott-mio/
ebookname.com
https://ebookname.com/product/electrical-insulation-for-rotating-
machines-1st-edition-greg-stone/
ebookname.com
https://ebookname.com/product/pauline-frommer-s-washington-d-c-
pauline-frommer-guides-1st-edition-james-t-yenckel/
ebookname.com
https://ebookname.com/product/organizational-behaviour-1st-edition-
daniel-king/
ebookname.com
The Heroic Slave A Cultural and Critical Edition Frederick
Douglass (Editor)
https://ebookname.com/product/the-heroic-slave-a-cultural-and-
critical-edition-frederick-douglass-editor/
ebookname.com
Java Programming Exercises
Take the first step in raising your coding skills to the next level, and test your Java knowledge on tricky
programming tasks, with the help of the pirate Captain CiaoCiao. This is the first of two volumes which
provide you with everything you need to excel in your Java journey, including tricks that you should know
in detail as a professional, as well as intensive training for clean code and thoughtful design that carries
even complex software.
Features:
With numerous best practices and extensively commented solutions to the tasks, these books provide the
perfect workout for professional software development with Java.
Java Programming Exercises
Volume One: Language Fundamentals and
Core Concepts
Christian Ullenboom
Designed cover image: Mai Loan Nguyen Duy, Rheinwerk Verlag GmbH
©2023 Christian Ullenboom. First published in the German language under the title “Captain CiaoCiao erobert Java”
(ISBN 978‑3‑8362‑8427‑1) by Rheinwerk Verlag GmbH, Bonn, Germany.
Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot
assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been
acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or
utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including
photocopying, microfilming, and recording, or in any information storage or retrieval system, without written
permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the
Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978‑750‑8400. For works that are
not available on CCC please contact [email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for
identification and explanation without intent to infringe.
DOI: 10.1201/9781003454502
Typeset in Times
by codeMantra
Introduction 1
Previous Knowledge and Target Audience 1
Working with This Book 2
The Suggested Solutions 2
Use of This Book 3
Required Software 3
Used Java Version in the Book 4
JVM 4
Development Environment 4
Conventions 4
Helping Captain CiaoCiao and Bonny Brain 5
2 Imperative Programming 9
Screen Output 9
Learn about the SVG Specification 9
Write an SVG Circle on the Console ⭑ 10
Variables and Data Types 11
Access Variables and Output Their Assignments ⭑ 12
Quiz: Value Ranges ⭑ 12
Quiz: Does This Add Up? ⭑⭑⭑ 12
Generate Random Circles ⭑ 13
Quiz: Dazed and Confused ⭑ 14
Process User Input ⭑ 14
Expressions, Operands, and Operators 14
Quiz: Check In-Between ⭑ 14
Check If Loot Can Be Shared Fairly ⭑ 15
Do Two Numbers Share the Same Digit? ⭑⭑ 15
Convert Currency Amount to Coins ⭑⭑ 15
One Bottle of Rum, Ten Bottles of Rum ⭑ 16
Quiz: The Zero Effect ⭑ 17
v
vi Contents
Control Flow 18
Payday ⭑ 18
Quiz: Wrong Branching ⭑ 18
Convert Liters ⭑⭑ 19
Create SVG Circles with Random Colors ⭑ 19
Quiz: To Which Block Does the Else Belong? ⭑⭑ 20
Quiz: Recognize Negative Days and Hours ⭑ 20
Evaluate Input Strings for Approval ⭑ 20
Rewrite Switch Statement to Switch Expression ⭑ 21
Loops 21
Create Rotated SVG Rectangles ⭑ 21
Create SVG‑Pearl‑Chain ⭑ 22
Sum Numbers from the Command Line ⭑ 23
Go through a Mathematical Phenomenon ⭑ 24
Quiz: How Many Stars? ⭑ 24
Calculate Products for Faculties ⭑ 25
Determine If a Number Is Formed by Factorial ⭑ 25
Find the Smallest and Largest Digit of a Number ⭑ 26
Quiz: Not Like This from 1 to 100 ⭑⭑ 27
A Flag in the Wind through Nested Loops ⭑ 28
Output Simple Chessboard ⭑ 28
It’s Christmastime: Displaying Trees with Ornaments ⭑ 29
Draw Fishy Stitching Motifs ⭑ 30
Trying Instead of Thinking ⭑⭑ 31
Get the Number of Digits of a Number ⭑⭑ 32
Methods 33
Drawing Hearts ⭑ 33
Implement Overloaded Line Methods ⭑ 34
Standing Straight ⭑ 34
Create a Multiplication Table ⭑ 35
Cistercian Numerals Script ⭑⭑⭑ 36
Quiz: What Does Ding‑Dong Do? (Recursion) ⭑⭑ 37
Quiz: Repdigit (Recursion) ⭑⭑ 37
Calculate Collatz Sequence (Recursion) ⭑ 38
Ancient Egyptian Multiplication (Recursion) ⭑⭑ 38
Suggested Solutions 40
Write an SVG Circle on the Console ⭑ 40
Access Variables and Output Their Assignments 41
Quiz: Value Ranges 42
Quiz: Does This Add Up? 43
Generate Random Circles 43
Quiz: Dazed and Confused 44
Process User Input 44
Quiz: Check In-Between 44
Check If Loot Can Be Shared Fairly 45
Do Two Numbers Share the Same Digit? 45
Convert Currency Amount to Coins 46
One Bottle of Rum, Ten Bottles of Rum 47
Quiz: The Zero Effect 47
Payday 47
Quiz: Wrong Branching 48
Contents vii
Convert Liters 48
Create SVG Circles with Random Colors 49
Quiz: To Which Block Does the Else Belong? 50
Quiz: Recognize Negative Days and Hours 50
Evaluate Input Strings for Approval 51
Rewrite Switch Statement to Switch Expression 52
Create Rotated SVG Rectangles 52
Create SVG‑Pearl‑Chain 53
Sum Numbers from the Command Line 53
Go through a Mathematical Phenomenon 54
Quiz: How Many Stars? 55
Calculate Products for Faculties 55
Determine If a Number Is Formed by Factorial 57
Find the Smallest and Largest Digit of a Number 58
Quiz: Not Like This from 1 to 100 58
A Flag in the Wind through Nested Loops 59
Output Simple Chessboard 60
It’s Christmastime: Displaying Trees with Ornaments 60
Draw Fishy Stitching Motifs 61
Trying Instead of Thinking 62
Get the Number of Digits of a Number 63
Drawing Hearts 65
Implement Overloaded Line Methods 65
Standing Straight 66
Create a Multiplication Table 68
Cistercian Numerals Script 69
Quiz: What Does Ding‑Dong Do? (Recursion) 72
Quiz: Repdigit (Recursion) 72
Calculate Collatz Sequence (Recursion) 73
Ancient Egyptian Multiplication (Recursion) 75
4 Arrays 86
Everything Has a Type 86
Quiz: Array Types ⭑ 86
One‑Dimensional Arrays 87
viii Contents
Appendix A: Most Frequent Types and Methods in the Java Universe 295
A.1 Packages with the Most Common Types 295
A.2 100 Most Common Types 296
A.3 100 Most Common Methods 299
A.4 100 Most Common Methods Including Parameter List 302
About the Author
Christian Ullenboom started his programming journey at the tender age of ten, typing his first lines of
code into a C64. After mastering assembler programming and early BASIC extensions, he found his call‑
ing on the island of Java, following his studies in computer science and psychology. Despite indulging in
Python, JavaScript, TypeScript, and Kotlin vacations, he remains a savant of all things Java.
For over 20 years, Ullenboom has been a passionate software architect, Java trainer (check out http://
www.tutego.com), and IT specialist instructor. His expertise has resulted in a number of online video
courses and reference books:
Christian Ullenboom has been spreading Java love through his books for years, earning him the coveted
title of Java Champion from Sun (now Oracle) way back in 2005. Only a select few—about 300 world‑
wide—have achieved this status, making him a true Java superstar.
As an instructor, Ullenboom understands that learning by doing is the most effective way to master a
skill. So, he has compiled a comprehensive catalog of exercises that accompany his training courses. This
book features a selection of those exercises, complete with documented solutions.
His roots are in Sonsbeck, a small town in the Lower Rhine region of Germany.
xv
Introduction
Many beginners in programming often ask themselves, “How can I strengthen my skills as a developer?
How can I become a better programmer?” The answer is simple: study, attend webinars, learn, repeat,
practice, and discuss your work with others. Many aspects of programming are similar to learning new
skills. Just as a book can’t teach you how to play a musical instrument, watching the Fast and the Furious
movie series won’t teach you how to drive. The brain develops patterns and structures through repeated
practice. Learning a programming language and a natural language have many similarities. Consistent
use of the language and the desire and need to express and communicate in it (just as you need to do so to
order a burger or a beer) lead to gradual improvement in skills.
Books and webinars on learning a programming language are available, but reading, learning,
practicing, and repeating are just one aspect of becoming a successful software developer. To cre‑
ate effective software solutions, you need to creatively combine your knowledge, just as a musician
regularly practices finger exercises and maintains their repertoire. The more effective your exercises
are, the faster you will become a master. This book aims to help you progress and gain more hands‑on
experience.
Java 21 declares more than 2,300 classes, about 1,400 interfaces, close to 140 enumerations, around
50 exceptions, and a few annotation types and records are included as well. However, only a fraction of
these types are relevant in practice. This book selects the most important types and methods for tasks,
making them motivating and following Java conventions. Alternative solutions and approaches are also
presented repeatedly. The goal is to make nonfunctional requirements clear because the quality of pro‑
grams is not just about “doing what it should”. Issues such as correct indentation, following naming con‑
ventions, proper use of modifiers, best practices, and design patterns are essential. The proposed solutions
aim to demonstrate these principles, with the keyword being Clean Code.
The book is centered around tasks and fully documented solutions, with detailed explanations of Java
peculiarities, good object‑oriented programming practices, best practices, and design patterns. The
exercises are best solved with a textbook, as this exercise book is not a traditional textbook. A useful
approach is to work through a topic with a preferred textbook before attempting the exercises that cor‑
respond to it.
DOI: 10.1201/9781003454502-1 1
2 Java Programming Exercises
The first set of tasks is designed for programming beginners who are new to Java. As you gain more
experience with Java, the tasks become more challenging. Therefore, there are tasks for both beginners
and advanced developers.
Additionally, this book does not require the use of tools like profiling tools, as these are beyond the
scope of this book.
1 star ★: Simple exercises, suitable for beginners. They should be easy to solve without much
effort. Often only transfer of knowledge is required, for example, by writing down things that
are in a textbook differently.
2 stars ★★: The effort is higher here. Different techniques have to be combined. Greater creativity
is required.
3 stars ★★★: Assignments with three stars are more complex, require recourse to more prior
knowledge, and sometimes require research. Frequently, the tasks can no longer be solved with
a single method, but require multiple classes that must work together.
REQUIRED SOFTWARE
While solving a task with just a pen and paper is possible in theory, modern software development requires
the proper use of tools. Knowing programming language syntax, object‑oriented modeling, and libraries
is just the tip of the iceberg. Understanding the JVM (Java Virtual Machine), using tools like Maven and
Git for version management, and becoming proficient in an IDE (Integrated Development Environment)
are all crucial aspects of professional software development. Some developers can even perform magic in
their IDE, generating code and fixing bugs automatically.
4 Java Programming Exercises
JVM
If we want to run Java programs, we need a JVM. In the early days, this was easy. The runtime environ‑
ment first came from Sun Microsystems, later from Oracle, which took over Sun. Today, it is much more
confusing. Although a runtime environment can still be obtained from Oracle, the licensing terms have
changed, at least for Java 8 up to Java 16. Testing and development are possible with the Oracle JDK,
but not in production. In this case, Oracle charges license fees. As a consequence, various institutions
compile their own runtime environments from the OpenJDK, the original sources. The best known are
Eclipse Adoptium (https://adoptium.net/), Amazon Corretto (https://aws.amazon.com/de/corretto), Red
Hat OpenJDK (https://developers.redhat.com/products/openjdk/overview), and others such as those from
Azul Systems or Bellsoft. There is no specific distribution that readers are required to follow.
Development Environment
Java source code is just plain text, so technically a simple text editor is all you need. However, relying solely
on Notepad or vi for productivity is like trying to win a race on a tricycle. Modern integrated development
environments support us with many tasks: color highlighting of keywords, automatic code completion,
intelligent error correction, insertion of code blocks, visualization of states in the debugger, and much more.
It is therefore advisable to use a full development environment. Four popular IDEs are: IntelliJ, Eclipse,
Visual Studio Code, and (Apache) NetBeans. Just like with Java runtime environments, the choice of IDE
is left to the reader. Eclipse, NetBeans, and Visual Studio Code are all free and open‑source, while IntelliJ
Community Edition is also free, but the more advanced IntelliJ Ultimate Edition will cost you some cash.
Halfway through the book, we delve into implementing project dependencies using Maven in a few
places.
CONVENTIONS
Code is written in fix width font, filenames are italicized. To distinguish methods from attributes,
methods always have a pair of parentheses, such as in “the variable max contains the maximum” or “it
returns max() the maximum”. Since methods can be overloaded, either the parameter list is named, as in
equals(Object), or an ellipsis abbreviates it, such as in “various println(…) methods”. If a group
of identifiers is addressed, * is written, like print*(...) prints something on the screen.
In the suggested solutions, there are usually only the relevant code snippets, so as not to blow up the
book volume. The name of the file is mentioned in the listing caption, like this:
VanillaJava.java
class VanillaJava { }
• Introduction 5
Sometimes, we need to flex our terminal muscles and execute programs from the command line (also
known as console or shell). Since each command‑line program has its own prompt sequence, it is symbol‑
ized here in the book with a $. Example:
$ java ‑version
openjdk version "21.0.1" 2023‑10‑17
OpenJDK Runtime Environment (build 21.0.1+12‑29)
OpenJDK 64‑Bit Server VM (build 21.0.1+12‑29, mixed mode, sharing)
If the Windows command line is explicitly meant, the prompt character > is set:
> netstat –e
Interface Statistics
Received Sent
6 DOI: 10.1201/9781003454502-2
1 • Introduction to the Java Ecosystem 7
$ javac Application.java
$ java Application
Question:
• Would it be possible to copy the file Application.class from a Windows operating system
to a Linux operating system and java can run the program?
• What software must be installed on the computer?
• IntelliJ.
• Eclipse.
• Visual Studio Code.
• (Apache) NetBeans IDE.
This workbook is completely independent of the IDE. All developers should work intensively with the
shortcuts, the debugger, and the other tools. The web pages of the developers and YouTube offer plenti‑
fully material for it, a small selection:
Task:
SUGGESTED SOLUTIONS
• If the class is public, the filename must be the same as the class. So, we could change the
filename or class name. The IDE recognizes the error and suggests a renaming.
• Keywords are always lowercase in Java. What happens if you capitalize a keyword like pub‑
lic or class or capitalize single letters? In that case, there is a compiler error.
• If the start method is not declared as public static void main(String[] args),
but differently, the editor cannot guess, but the compiler will translate the program correctly
because public static void run(String[] args) could, in general, be a method
we want. It is a semantic error and not a syntactic error, which the editor or the compiler can‑
not notice. But the runtime environment will throw an error that the main(…) method is not
present when the program is to be started (semantic error).
• A method consists of a sequence of statements—these statements are in a block enclosed in
curly braces. The same is true for the class, which consists of a collection of methods that must
also be placed in a block altogether. Indentations are not significant in Java. You can provoke
an error by omitting the curly braces completely.
• Every open curly bracket requires a closing curly bracket. If you omit a curly bracket, it will
cause a compiler error.
• String literals are enclosed with different symbols in different programming languages. Some
programming languages use double quotes ("), other programming languages use a single
quote ('), and some programming languages use backticks (`). Java can accept the strings only
in double quotes; otherwise, there will be compiler errors. Single quotes are used for single
characters (data type char).
• In Java, white space is used to make the source code clearer, especially to make the blocks vis‑
ible. You can save some white space. You can try to find out which of the whitespace characters
you are allowed to delete and which you are not. The code given in the task is fine.
Random documents with unrelated
content Scribd suggests to you:
CHAPTER VII
WHAT THE RED ENVELOPE HELD
“My dear Angel,” wrote Jimmy, “I commend to you one Mr. Spedding,
an ingenious man. If by chance you ever wish to visit him, do so in
business hours. If you desire to examine his most secret possession,
effect an entrance into a dreary-looking house at the corner of Cley’s
Road, a stone’s-throw from ‘High Holly Lodge.’ It is marked in plain
characters ‘To Let.’ In the basement you will find a coal-cellar.
Searching the coal-cellar diligently, you will discover a flight of stone
steps leading to a subterranean passage, which burrows under the
ground until it arrives at friend Spedding’s particular private vault. If
this reads like a leaf torn from Dumas or dear Harrison Ainsworth it is
not my fault. I visited our legal adviser last night, and had quite a
thrilling evening. That I am alive this morning is a tribute to my
caution and foreseeing wisdom. The result of my visit is this: I have
the key of the ‘safe-word’ in my hands. Come and get it.”
Angel found the message awaiting him when he reached Scotland
Yard that morning. He too had spent sleepless hours in a futile
attempt to unravel the mystery of old Reale’s doggerel verse.
A telegram brought Kathleen Kent to town. Angel met her at a quiet
restaurant in Rupert Street, and was struck by the delicate beauty of
this slim girl with the calm, gray eyes.
She greeted him with a sad little smile.
“I was afraid you would never see me again after my outburst of the
other night,” she said. “This—this—person is a friend of yours?”
“Jimmy?” asked the detective cheerily. “Oh, yes, Jimmy’s by way of
being a friend; but he deserved all you said, and he knows it, Miss
Kent.”
The girl’s face darkened momentarily as she thought of Jimmy.
“I shall never understand,” she said slowly, “how a man of his gifts
allowed himself to become——”
“But,” protested the detective, “he told you he took no part in the
decoying of your father.”
The girl turned with open-eyed astonishment.
“Surely you do not expect me to believe his excuses,” she cried.
Angel Esquire looked grave.
“That is just what I should ask you to believe,” he said quietly.
“Jimmy makes no excuses, and he would certainly tell no lie in
extenuation of his faults.”
“But—but,” said Kathleen, bewildered, “he is a thief by his own
showing—a bad man.”
“A thief,” said Angel soberly, “but not a bad man. Jimmy is a puzzle
to most people. To me he is perfectly understandable; that is
because I have too much of the criminal in my own composition,
perhaps.”
“I wish, oh, how I wish I had your faith in him! Then I could absolve
him from suspicion of having helped ruin my poor father.”
“I think you can do that,” said the detective almost eagerly. “Believe
me, Jimmy is not to be judged by conventional standards. If you ask
me to describe him, I would say that he is a genius who works in an
eccentric circle that sometimes overlaps, sometimes underreaches
the rigid circle of the law. If you asked me as a policeman, and if I
was his bitterest enemy, what I could do with Jimmy, I should say,
‘Nothing.’ I know of no crime with which I could charge him, save at
times with associating with doubtful characters. As a matter of fact,
that equally applies to me. Listen, Miss Kent. The first big
international case I figured in was a gigantic fraud on the Egyptian
Bank. Some four hundred thousand pounds were involved, and
whilst from the outsider’s point of view Jimmy was beyond suspicion,
yet we who were working at the case suspected him, and pretty
strongly. The men who owned the bank were rich Egyptians, and the
head of all was a Somebody-or-other Pasha, as great a scoundrel as
ever drew breath. It is impossible to tell a lady exactly how big a
scoundrel he was, but you may guess. Well, the Pasha knew it was
Jimmy who had done the trick, and we knew, but we dare not say so.
The arrest of Jimmy would have automatically ruined the banker.
That was where I realized the kind of man I had to deal with, and I
am always prepared when Jimmy’s name is mentioned in connection
with a big crime to discover that his victim deserved all he got, and a
little more.”
The girl gave a little shiver.
“It sounds dreadful. Cannot such a man as that employ his talents to
a greater advantage?”
Angel shrugged his shoulders despairingly.
“I’ve given up worrying about misapplied talents; it is a subject that
touches me too closely,” he said. “But as to Jimmy, I’m rather glad
you started the conversation in that direction, because I’m going to
ask you to meet him to-day.”
“Oh, but I couldn’t,” she began.
“You are thinking of what happened on the night the will was read?
Well, you must forget that. Jimmy has the key to the verse, and it is
absolutely imperative that you should be present this afternoon.”
With some demur, she consented.
In the sitting-room of Jimmy’s flat the three sat round a table littered
with odds and ends of papers.
The girl had met him with some trepidation, and his distant bow had
done more to assure her than had he displayed a desire to
rehabilitate himself in her good opinion.
Without any preliminaries, Jimmy showed the contents of the packet.
He did not explain to the girl by what means he had come into
possession of them.
“Of all these papers,” began Jimmy, tapping the letter before him,
“only one is of any service, and even that makes confusion worse
confounded. Reale had evidently had this cursed cryptogram in his
mind for a long time. He had made many experiments, and rejected
many. Here is one.”
He pushed over a card, which bore a few words in Reale’s
characteristic hand.
Angel read:—
Sanda.
Milford Haven.
Orkneys.
Caldy Island.
Kinnaird Head.
They form an acrostic, and the initial letters form the work ‘smock’;
but it was too easy—and too hard, because there are two or three
lights, particularly the fixed lights, that are exactly the same, so he
dropped that idea.”
Angel breathed an admiring sigh.
“Jimmy, you’re a wonder,” he said simply.
Jimmy, busying himself amongst the papers, stole a glance at the
girl.
“I am very human,” he thought, and was annoyed at the discovery.
“Now we come to the more important clue,” he said, and smoothed a
crumpled paper on the table.
“This, I believe, to have a direct bearing on the verse.”
Then three heads came close together over the scrawled sheet.
“A picture of a duck, which means T,” spelt Angel, “and that’s erased;
and then it is a snake that means T——”
Jimmy nodded.
“In Reale’s verse,” he said deliberately, “there are six words; outside
of those six words I am convinced the verse has no meaning. Six
words strung together, and each word in capitals. Listen.”
He took from his pocketbook the familiar slip on which the verse was
written:—
“Here’s a puzzle in language old,
Find my meaning and get my gold.
Take one BOLT—just one, no more—
Fix it on behind a DOOR.
Place it at a river’s MOUTH
East or west or north or south.
Take some LEAVES and put them whole
In some WATER in a BOWL.
I found this puzzle in a book
From which some mighty truths were took.”
“There are six words,” said Jimmy, and scribbled them down as he
spoke:—
“Bolt (or Bolts). Leave (or Leaves).
Door. Water.
Mouth. Bowl.
Each one stands for a letter—but what letter?”
“It’s rather hopeless if the old man has searched round for all sorts of
out-of-the-way objects, and allowed them to stand for letters of the
alphabet,” said Angel.
The girl murmured something, and met Jimmy’s inquiring eyes.
“I was only saying,” she said hesitatingly, “that there seems to be a
method in all this.”
“Except,” said Jimmy, “for this,” and he pointed to the crossed-out
duck. “By that it would seem that Reale chose his symbols
haphazard, and that the duck not pleasing him, he substituted the
snake.”
“But,” said Kathleen, addressing Angel, “doesn’t it seem strange that
an illiterate man like Mr. Reale should make even these rough
sketches unless he had a model to draw from?”
“Miss Kent is right,” said Jimmy quickly.
“And,” she went on, gaining confidence as she spoke, “is there not
something about these drawings that reminds you of something?”
“Of what?” asked Angel.
“I cannot tell,” she replied, shaking her head; “and yet they remind
me of something, and worry me, just as a bar of music that I cannot
play worries me. I feel sure that I have seen them before, that they
form a part of some system——” She stopped suddenly.
“I know,” she continued in a lower voice; “they are associated in my
mind—with—with the Bible.”
The two men stared at her in blank astonishment. Then Jimmy
sprang to his feet, alight with excitement.
“Yes, yes,” he cried. “Angel, don’t you see? The last two lines of
Reale’s doggerel—
“‘I found this puzzle in a book
From which some mighty truths were took.’”
“Go on, go on, Miss Kent,” cried Angel eagerly. “You are on the right
track. Try to think——”
Kathleen hesitated, then turned to Jimmy to address the first remark
she had directed to him personally that day.
“You haven’t got——?”
Jimmy’s smile was a little hard.
“I’m sorry to disappoint you, Miss Kent, but I have got a copy,” he
said, with a touch of bitterness in his tone. He walked to the
bookcase at one end of the room and reached down the book—a
well-worn volume—and placed it before her.
The rebuke in his voice was deserved, she felt that.
She turned the leaves over quickly, but inspiration seemed to have
died, for there was nothing in the sacred volume that marshaled her
struggling thoughts.
“Is it a text?” asked Angel.
She shook her head.
“It is—something,” she said. “That sounds vague, doesn’t it? I
thought if I had the book in my hand, it would recall everything.”
Angel was intently studying the rebus.
“Here’s one letter, anyway. You said that, Jimmy?”
“The door?” said Jimmy. “Yes, that’s fairly evident. Whatever the
word is, its second letter is ‘P.’ You see Reale’s scribbled notes? All
these are no good, the other letters are best, I suppose it means; so
we can cut out ‘T,’ ‘O,’ and ‘K.’”
“The best clue of all,” he went on, “is the notes about the ‘professor.’
You see them:
“‘Mem.: To get the professor’s new book on it.
Mem.: To do what the professor thinks right.
Mem.: To write to professor about——’
Now the questions are: Who is the professor, what is his book, and
what did he advise? Reale was in correspondence with him, that is
certain; in his desire for accuracy, Reale sought his advice. In all
these papers there is no trace of a letter, and if any book exists it is
still in Sped—it is still in the place from whence this red envelope
came.”
The two men exchanged a swift glance.
“Yes,” said Angel, as if answering the other’s unspoken thought, “it
might be done.”
The girl looked from one to the other in doubt.
“Does this mean an extra risk?” she asked quietly. “I have not
questioned you as to how this red envelope came into your
possession, but I have a feeling that it was not obtained without
danger.”
Angel disregarded Jimmy’s warning frown. He was determined that
the better side of his strange friend’s character should be made
evident to the girl.
“Jimmy faced death in a particularly unpleasant form to secure the
packet, Miss Kent,” he said.
“Then I forbid any further risk,” she said spiritedly. “I thought I had
made it clear that I would not accept favors at your friend’s hands;
least of all do I want the favor of his life.”
Jimmy heard her unmoved. He had a bitter tongue when he so
willed, and he chose that moment.
“I do not think you can too strongly impress upon Miss Kent the fact
that I am an interested party in this matter,” he said acidly. “As she
refused my offer to forego my claim to a share of the fortune, she
might remember that my interest in the legacy is at least as great as
hers. I am risking what I risk, not so much from the beautifully
quixotic motives with which she doubtless credits me, as from a
natural desire to help myself.”
She winced a little at the bluntness of his speech; then recognizing
she was in the wrong, she grew angry with herself at her
indiscretion.
“If the book is—where these papers were, it can be secured,” Jimmy
continued, regaining his suavity. “If the professor is still alive he will
be found, and by to-morrow I shall have in my possession a list of
every book that has ever been written by a professor of anything.”
Some thought tickled him, and he laughed for the second time that
afternoon.
“There’s a fine course of reading for us all,” he said with a little
chuckle. “Heaven knows into what mysterious regions the literary
professor will lead us. I know one professor who has written a
treatise on Sociology that runs into ten volumes, and another who
has spoken his mind on Inductive Logic to the extent of twelve
hundred closely-printed pages. I have in my mind’s eye a vision of
three people sitting amidst a chaos of thoughtful literature, searching
ponderous tomes for esoteric references to bolts, door, mouth, et
cetera.”
The picture he drew was too much for the gravity of the girl, and her
friendship with the man who was professedly a thief, and by
inference something worse, began with a ripple of laughter that
greeted his sally.
Jimmy gathered up the papers, and carefully replaced them in the
envelope. This he handed to Angel.
“Place this amongst the archives,” he said flippantly.
“Why not keep it here?” asked Angel in surprise.
Jimmy walked to one of the three French windows that opened on to
a small balcony. He took a rapid survey of the street, then beckoned
to Angel.
“Do you see that man?” He pointed to a lounger sauntering along on
the opposite sidewalk.
“Yes.”
Jimmy walked back to the center of the room.
“That’s why,” he said simply. “There will be a burglary here to-night or
to-morrow night. People aren’t going to let a fortune slip through their
fingers without making some kind of effort to save it.”
“What people?” demanded the girl. “You mean those dreadful men
who took me away?”
“That is very possible,” said Jimmy, “although I was thinking of
somebody else.”
The girl had put on her wrap, and stood irresolutely near the door,
and Angel was waiting.
“Good-by,” she said hesitatingly. “I—I am afraid I have done you an
injustice, and—and I want to thank you for all you have undergone
for me. I know—I feel that I have been ungracious, and——”
“You have done me no injustice,” said Jimmy in a low voice. “I am all
that you thought I was—and worse.”
She held out her hand to him, and he raised it to his lips, which was
unlike Jimmy.
CHAPTER VIII
OLD GEORGE