[FREE PDF sample] (eBook PDF) Building Java Programs: A Back to Basics Approach 5th Edition ebooks
[FREE PDF sample] (eBook PDF) Building Java Programs: A Back to Basics Approach 5th Edition ebooks
com
https://ebookluna.com/product/ebook-pdf-building-java-
programs-a-back-to-basics-approach-5th-edition/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookluna.com/product/building-java-programs-a-back-to-basics-
approach-4th-edition-ebook-pdf/
ebookluna.com
https://ebookluna.com/download/building-java-programs-a-back-to-
basics-approach-ebook-pdf-2/
ebookluna.com
https://ebookluna.com/download/building-java-programs-a-back-to-
basics-approach-ebook-pdf/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-building-java-programs-a-back-
to-basics-approach-4th-edition-by-stuart-reges/
ebookluna.com
(eBook PDF) Building Python Programs 1st Edition
https://ebookluna.com/product/ebook-pdf-building-python-programs-1st-
edition/
ebookluna.com
https://ebookluna.com/download/java-a-beginners-guide-create-compile-
and-run-java-programs-today-ebook-pdf/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-introduction-to-programming-
with-java-a-problem-solving-approach-3rd-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-organizational-behavior-a-
skill-building-approach-2nd-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-a-practical-approach-to-
alternative-dispute-resolution-5th-edition/
ebookluna.com
Preface
The newly revised fifth edition of our Building Java Programs textbook is
designed for use in a two-course introduction to computer science. We have
class-tested it with thousands of undergraduates, most of whom were not
computer science majors, in our CS1-CS2 sequence at the University of
Washington. These courses are experiencing record enrollments, and other
schools that have adopted our textbook report that students are succeeding
with our approach.
Introductory computer science courses are often seen as “killer” courses with
high failure rates. But as Douglas Adams says in The Hitchhiker’s Guide to
the Galaxy, “Don’t panic.” Students can master this material if they can learn it
gradually. Our textbook uses a layered approach to introduce new syntax and
concepts over multiple chapters.
The Java language is always evolving, and we have made it a point of focus
in recent editions on newer features that have been added in Java 8 through
10. In the fourth edition we added a new Chapter 19 on Java’s functional
programming features introduced in Java 8. In this edition we integrate the
JShell tool introduced in Java 9.
This year also marks the release of our new Building Python Programs
textbook, which brings our “back to basics” approach to the Python language.
In recent years Python has seen a surge in popularity in introductory computer
science classrooms. We have found that our materials and approach work as
well in Python as they do in Java, and we are pleased to offer the choice of
two languages to instructors and students.
The following table shows how the layered approach works in the first six
chapters:
Answers to all self-check problems appear on our web site and are accessible
to anyone. Our web site has the following additional resources for students:
Our web site has the following additional resources for teachers:
VideoNotes
We have recorded a series of instructional videos to accompany the textbook.
They are available at the following web site:
http://www.pearsonhighered.com/cs-resources
Roughly 3–4 videos are posted for each chapter. An icon in the margin of the
page indicates when a VideoNote is available for a given topic. In each video,
we spend 5–15 minutes walking through a particular concept or problem,
talking about the challenges and methods necessary to solve it. These videos
make a good supplement to the instruction given in lecture classes and in the
textbook. Your new copy of the textbook has an access code that will allow
you to view the videos.
Acknowledgments
First, we would like to thank the many colleagues, students, and teaching
assistants who have used and commented on early drafts of this text. We
could not have written this book without their input. Special thanks go to
Hélène Martin, who pored over early versions of our first edition chapters to
find errors and to identify rough patches that needed work. We would also like
to thank instructor Benson Limketkai for spending many hours performing a
technical proofread of the second edition.
Second, we would like to thank the talented pool of reviewers who guided us
in the process of creating this textbook:
Finally, we would like to thank the great staff at Pearson who helped produce
the book. Michelle Brown, Jeff Holcomb, Maurene Goo, Patty Mahtani, Nancy
Kotary, and Kathleen Kenny did great work preparing the first edition. Our
copy editors and the staff of Aptara Corp, including Heather Sisan, Brian
Baker, Brendan Short, and Rachel Head, caught many errors and improved
the quality of the writing. Marilyn Lloyd and Chelsea Bell served well as
project manager and editorial assistant respectively on prior editions. For their
help with the third edition we would like to thank Kayla Smith-Tarbox,
Production Project Manager, and Jenah Blitz-Stoehr, Computer Science
Editorial Assistant. Mohinder Singh and the staff at Aptara, Inc., were also
very helpful in the final production of the third edition. For their great work on
production of the fourth and fifth editions, we thank Louise Capulli and the
staff of Lakeside Editorial Services, along with Carole Snyder at Pearson.
Special thanks go to our lead editor at Pearson, Matt Goldstein, who has
believed in the concept of our book from day one. We couldn’t have finished
this job without all of their hard work and support.
Stuart Reges
Marty Stepp
Location of Video Notes in the Text
http://www.pearson.com/cs-resources
Chapter 10 667
While he was still speaking the gypsies deserted the stage, leaving it bare
now save for the great piano. Again a brief hush and there emerged from
behind the painted screen with a curious effect of abruptness and lack of
grace a tall girl, very tall and very straight, with smooth black hair done in
the style of Cléo de Merode and cheeks that were flushed. She wore a plain
gown of black very tight and girdled with rhinestones that, shimmering,
threw off shattered fragments of light as she walked. Her strong white arms
were bared to the shoulder. There was pride in her walk, and assurance, yet
these things hid a terror so overpowering that only those who sat quite near
saw that her lip was bleeding where she had bitten it.
On her little throne Thérèse Callendar in cold blood waited. She
wondered, doubtless, whether Sanson had failed her, and slowly she began
to perceive that he had not. Somehow as she emerged from behind the
screen, the American girl captured the imagination of her audience; it was
as if she dominated them by some unreal power. They stirred and looked
more closely. It was not altogether a matter of beauty, for the dancer who
had preceded her was by all the rules far more beautiful. It was something
beyond mere physical beauty. It emanated from her whole body, running
outward, engulfing all the little audience. They became aware of her.
“Hm!” murmured Mrs. Callendar. “Here is something new. Something
magnificent. A born actress ... crude still, but with magnetism!” And she
raised her lorgnettes and peered very hard with her short sighted little eyes.
To Richard Callendar, Sabine murmured, “Interesting! Who is she?”
“She’s very handsome.... A discovery of Mama’s.”
And then, seating herself the girl began after a shower of liquid notes, to
play, softly and suggestively, a Chopin valse, one that was filled with
melody and simple rhythm. After the hot passion of the dancer she filled the
great room with the effect of a soft wind infinitely cool and lovely, serene in
its delicacy. She appeared presently to forget her fright and gave a
performance that was beautiful not alone in sound but in manner as well. It
may have been that old Sanson taught her that a great performance meant
more than merely making beautiful sounds. All her face and body played
their part in the poise, the grace of every movement, the sweep and the
gesture. But it is more probable that she was born knowing these things, for
they are a matter more of instinct than of training and lie thus beyond the
realm of mere instruction.
There could be no doubt of the impression she made, yet in all the
audience there was none, unless it was old Thérèse Callendar, who
suspected that she had never before played in the presence of anything but a
small town audience. There was in her performance the fire of wild
Highland ancestors, the placidity of English lanes, the courage of men who
had crossed mountains into a wilderness, perhaps even the Slavic passion of
a dim ancestress brought from Russia to live among the dour Scots of
Edinburgh, the hard, bright intelligence of Gramp, and the primitive energy
of Hattie Tolliver. There was all the stifled emotion pent so long in a heart
dedicated to secrecy, and the triumph of wild dreams; and there was too a
vast amount of passion for that little company who believed in her, whom
she dared not betray by failure ... for Lily whose very gown she wore, and
the withered Miss Ogilvie; for Gramp, and young Fergus who worshiped
her with his eyes, for her gentle father and the fierce old woman in Shane’s
Castle; but most of all for that indomitable and emotional woman whom she
must repay one day by forcing all the world to envy her.
When she had finished she was forced to return because overtones of all
this wild emotion had filtered vaguely into the very heart of the restless,
distracted audience on stiff collapsible chairs. They applauded; it was as if
she had suddenly claimed them.
Then she played savagely the Revolutionary Prelude and disappeared
behind the lacquered screen. There was a hush and then more talk and then
a sudden excitement which began at the screen and ran in little ripples
through all the stiff gathering. From the alcove there emerged the bass
rumbling of the Russian, stirred suddenly into somnolent activity, and again
a wild tinkling of little bells and a torrent of French in the shrill voice of the
Javanese dancer. The screen parted and the dancer, half naked, covered only
by the heavy gold ornaments and a wrapper of scarlet silk, emerged
chattering French and gesticulating. She addressed Mrs. Callendar who
stirred herself into a sudden dull glitter of movement. The son left the ugly
Sabine and joined his mother, calm but with a fierce, bright look in his eyes.
The American girl ... the unknown pianist had fainted!
24
Long after midnight the carriage came to a halt before the gigantic
Syrian lions of cast iron that ornamented the entrance to the Babylon Arms.
It was young Callendar who descended first, lending his arm with a grave
and alien grace to Ellen who, having recovered entirely, emerged with a
sure and vigorous step. The third occupant, instead of remaining behind as
she might well have been expected to do, followed them, driven by an
overpowering desire to miss nothing. So with Ellen between them,
Callendar in a top hat, and Sabine Cane, muffled in sables and holding her
full yellow train high above the wet pavements, descended upon the
astonished negro who ran the elevator.
Here Ellen bade them good night. “I’m all right now.... It was good of
you to have come.”
But they insisted upon accompanying her. There were protests, into
which there entered a sudden note of desperation as if the girl were striving
to conceal something which lay hidden at the top of the flamboyant
apartment.
“But you might faint again,” protested Sabine firmly. “I shan’t be
satisfied until I see you safe in your flat.”
“Besides,” observed young Callendar, smiling, “some day the Babylon
Arms will be mine. I should like to see what it looks like, abovestairs.”
So they pressed her until at last she yielded and in their company was
borne aloft in the swaying elevator. As it jolted to a halt, she bade them
good night once more, saying, “The elevator only runs this far and I live
two flights above. I’ll go the rest of the way alone.”
But they went with her through the red painted corridors under the light
of the flickering gas up the flights of stairs to a door which she opened with
her own key. There at last the farewells were made, for she did not invite
them to enter.
“My mother will call in the morning,” said Callendar, “to see that you
are not really ill.... Oh yes! You couldn’t prevent her! You don’t know her
as well as I do!”
“Good night.”
“Good night.”
And as the door closed they caught a sudden glimpse of a man, standing
timidly in the dim light of an inner room, listening with an air of curiosity
to their talk. He was a small man and rather thin, and stood dressed in a
shirt and trousers. His hair was rumpled; obviously he had been “sitting
up.” Behind him there was a table covered with papers and accounts. All
this the shrewd eye of Sabine captured in one swift instant.
As they descended under the guidance of the negro, Callendar said, “The
man ... who was he?”
“Some one ... perhaps her lover. Musicians have lovers....”
Her companion turned sharply. “No ...” he said, “not a lover. A woman
with such spirit wouldn’t have that sort of lover.”
Sabine laughed softly and with a hint of wickedness in her voice. “You
don’t know women ... how queer they can be. Besides....” And she indicated
with a nod of her red head the listening negro. “One must be careful.” But
she regarded Callendar with a new interest and during the long ride back
through the park she remained silent save to comment now and then upon
the bits of gossip which he discussed. Knowing him so well, perhaps she
understood that a new source of disturbance had crossed his path. There
was between them a remarkable sense of intimacy, as if each expected the
other to understand him perfectly.
By the time they reached the solid house on Murray Hill the party was
already on the wane and the guests had begun, in a motley stream, to leave.
Mrs. Champion and her daughters disappeared among the first after Mrs.
Callendar had the audacity to bring forward the artists and beg them to join
the guests. The Russian tenor stood awkwardly alone and in a corner and
the tiny dancer, in a turban and gown of crimson and gold brocade, sat
surrounded by young men. She had learned the business of entertaining
during those early days in Alexandria.
25
Once the door was closed, Ellen flung herself into a chair and sat staring
out of the window into the gray clouds that swept across the sky high above
the North River. It must have occurred to her then that Mrs. Callendar had
departed with an amazing amount of information ... knowledge which
concerned herself and her family, her future, her plans, even the details of
the very flat in which she lived. Her guest had, after a fashion, absorbed her
and her life much as a sponge absorbs water. By now Mrs. Callendar could
doubtless have drawn a detailed and accurate picture of the flat and written
a history of its occupant. Indeed she had very nearly tripped Ellen into one
unfortunate truthfulness. That was a fascinating thought ... Lily and her
strange foreign life. Lily a widow? What were her morals? How did she live
in Paris? Surely no one in the Town could have had the faintest idea. But
Madame Shane! Still Mrs. Callendar might have been mistaken. It would
have been, under the circumstances, a natural error. It was as though Lily
was destined in some unreal fashion to play a part in Ellen’s own life.
Always she was there, or at least some hint of her. Even Clarence talked of
her in a way he did not use when speaking of other women. Yet no one
knew anything of Lily.
Smiling dimly she rose, and before returning to her music she took the
brass ash tray containing the remains of Mrs. Callendar’s scented cigarette
and cleaned it thoroughly, taking care to bury the offending morsels well
out of sight where Clarence could never find them. Certainly she performed
this act through no fear of him. Rather it was with an air of secrecy as if
already she and her visitor had entered into a conspiracy. It may have been
only a touch of that curious understanding which flashes sometimes
between persons of great character.
26
T HE life of Mr. Wyck was no longer of interest to any one; yet there were
times, usually after a stronger dose than usual of his wife’s power and
independence, when Clarence sought the company of Wyck with the air
of a man in need of refreshment and rest. For she had brought into the lives
of both men a sense of strain which, during the days of their amiable
companionship on the top floor of the Babylon Arms, had been utterly
lacking. To Clarence, this new condition of affairs remained a mystery; but
Wyck, with an intuition that was feminine, must sometimes have come
close to the real reason.
He knew, beyond all doubt, that Ellen, for all her indifference, was his
enemy—an enemy who never once considered her foe, an enemy who in
her towering self-sufficiency had not troubled to include him in her
reckoning. There were times, during the lunches the two men had together
in a tiny restaurant in Liberty Street, when he came very close to speaking
the truth, so close that Clarence, moved by a shadowy and pathetic loyalty,
turned the talk of his companion into other channels. People said that a wife
made a difference with one’s friends, that marriage ended old friendships
and began new ones. There were, to be sure, old ones that had come very
near to the end of the path, but in their place there were no new ones. It was
wonderful how Ellen appeared to exist without friends.
“She is busy, I suppose,” he confided in admiration to Wyck over the
greasy table, “and she is more independent than most women but still I
don’t see how she stands it. She might have had Bunce’s wife for a friend.”
Wyck said, “Oh, no! She’s not good enough for her.” And then as if he
had spoken too bitterly, he added, “I can understand that. Bunce’s wife is a
vulgar woman.” He had never forgiven the contractor’s daughter the theft of
Bunce. He hated her so strongly that in order to disparage her, it was
necessary by comparison to reflect praise upon another enemy.
There were at times long silences when neither man spoke at all, for
even their talk of shop came to an end after it had been turned over and over
a hundred times. What thoughts occurred in those tragic silences neither
one could have revealed to the other because they were in the realm of
those things which friends, or even those who cling to the rags of
friendship, cannot afford to tell each other.
Clarence with his nose-glasses and neat white collar drank his thin
coffee and thought, “Wyck is a dull fellow. How could I ever have liked
him? Funny how men grow apart.”
And across the table Wyck, finishing his apple sauce, thought, “Ah, if
only there was some way to save him. That woman is destroying him
slowly, bit by bit. He should never have married her. If only I could get him
back where he would be happy again.”
There were in these thoughts the vestiges of truth. At one time they were
more filled with truth than at another, for no thing is true persistently and
unutterably. Yet in their truth Clarence was the happier of the two because
he had discovered in his marriage a freedom of a new and different sort;
through Ellen he was strong enough to yield nothing to the shabby little
man who sat opposite him. In some way he had caught a sense of her
independence, a knowledge that she was not as other women, or even as
most men. She belonged to the ruthless and the elect. As for Wyck, he had
only his sense of loss, for which there was no reward, and a pang which he
was resolved one day to heal by some revenge, as yet vague and unplanned.
And in his heart he believed that friendship between men was a bond far
finer, far more pure than any relation between a man and woman.
“See!” he thought, over his apple sauce, “what it is doing to Clarence. It
is destroying him. His love for her is consuming him.”
And when they had finished eating and had paid the yellow-haired
cashier who sat enthroned behind the till, it was their habit to saunter into
the streets and lose themselves in the noon crowds of lower Broadway.
Sometimes they wandered as far as the Battery to sit on a bench and watch
the fine ships going proudly across a bay of brilliant blue out to the open
sea. But there was not much pleasure in their promenade. It ended always in
the same fashion with Clarence looking at his watch to observe, “It’s time
we started back.”
And so they would return, back the same way over the same streets and
over the same doorstep. There were times when the sight of the blue sea and
the great ships sliding silently through the green water filled the heart of
Mr. Wyck with a wild turbulence which was beyond his understanding.
Those were times when he hated both his friend and the woman who held
him prisoner.
But no one was really interested in Mr. Wyck. In the evening when he
returned to the gas-lit bed room in Lexington Avenue there was nothing for
him to do. He read sometimes, but not frequently, and on warm nights he
sat on the doorstep watching the passers-by and exchanging a word now
and then with the grim woman who was his landlady. There were long
hours in which there was nothing to do but to think, and not even the gray
cat, watching the shadow of her tail against the decaying brownstone of the
doorstep, could have guessed the dark trend of those secret thoughts.
His life, his happiness had been ruined by a stranger who scorned even
to think of him.
And what then of Ellen herself? She was not, surely, unconscious of all
that was happening so slowly, so imperceptibly about her. It is true that she
was one of those who are born to success, one for whom the past does not
exist and the present has reality only in so far as it provides a step into the
future. Indeed, during those years in the city, even the Town itself became a
very distant and shadowy memory. She was concerned, desperately, with
what lay before her, confused perhaps by a sense of imminent disaster so
vague that it could have for her no real meaning or significance.
But of course she never spoke of these things to her husband, perhaps
because she was conscious that he might not understand them. At times the
old pity for him, the same pity which had seized her so unaccountably upon
the night of their flight, overwhelmed her, and at such moments it was her
habit to be tender with him in a fashion that sent him into extravagant
flights of happiness. But these moments became, after a while, conscious
things on the part of Ellen so that presently she used them cheaply to quiet
his unhappiness as one might use a gaudy stick of candy to quiet an
unhappy child. Such little things made him happy.
Sometimes in the night she would lie in one of the green beds
ornamented with garlands of salmon pink roses, listening to the sounds of
the city that lay far beneath them ... the distant rumble which rose and
mingled somehow with the glow of light that filled all the dome of the sky,
a rumble pierced sharply by the sudden shrill cry of a city child playing late
in the streets, or the faint clop! clop! of hoofs upon asphalt blurred now and
again by the ghostly boom of a great ship’s whistle rising from the fog-
veiled river ... marvelous, splendorous sounds of a great world close at
hand. There lay in these sounds a wonderful sense of the crowd—in which
she herself was not a part. Lying there, her fingers would clutch the
bedclothes tightly and presently she would become conscious that in her
listening she was not alone, that beside her, separated by the little chasm
which divided the two green beds, Clarence too lay awake ... listening. She
must have known in those hours an unreal consciousness of something that
was waiting ... a Thing destined not to become clear until long afterward ...
a Thing which waited silently and with a terrible patience. It was an
experience that was not rare; it happened many nights, so that presently she
came to be happy in the weeks when Clarence, traveling through the night
hundreds of miles from her, was not there at all.
Sometimes her hand would steal out and in the darkness be touched and
clasped by another hand that trembled and clung to hers in a sort of terror.
27
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookluna.com