(eBook PDF) Java Foundations: Introduction to Program Design and Data Structures 5th Edition instant download
(eBook PDF) Java Foundations: Introduction to Program Design and Data Structures 5th Edition instant download
https://ebooksecure.com/product/ebook-pdf-java-foundations-
introduction-to-program-design-and-data-structures-5th-edition/
http://ebooksecure.com/product/ebook-pdf-introduction-to-java-
programming-and-data-structures-comprehensive-version-11/
http://ebooksecure.com/product/data-structures-and-abstractions-
with-java-5th-edition-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-introduction-to-java-
programming-and-data-structures-comprehensive-version-11th-
global-edition/
https://ebooksecure.com/download/c-programming-program-design-
including-data-structures-ebook-pdf/
(eBook PDF) Data Structures and Abstractions with Java
5th Edition by Frank M. Carrano
http://ebooksecure.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-5th-edition-by-frank-m-carrano/
http://ebooksecure.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-edition/
http://ebooksecure.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-global-edition/
http://ebooksecure.com/product/ebook-pdf-data-structures-and-
other-objects-using-java-4th-edition/
http://ebooksecure.com/product/ebook-pdf-data-structures-and-
problem-solving-using-java-4th-edition/
To my wife, Sharon, for everything.
– John
To my wonderful wife Susan, and our children, Grace, Anthony, Adam, Lily, EJ, and Peter IV.
Your continued love and support keep me going as always.
– Pete
xiii
xiv CONTENTS
2.4 Expressions 51
Arithmetic Operators 51
Operator Precedence 52
Increment and Decrement Operators 56
Assignment Operators 57
3.3 Packages 83
The import Declaration 84
Conversions940
Arcs970
CO N T E N T S xxvii
Images974
Fonts976
Index 1037
Credits
xxix
xxx C REDITS
It has been already stated that Rough and Ready had made a
careful estimate of his expenses, and found that to meet them,
including clothing, he must average seven dollars and seventy-two
cents weekly. He might get along on less, but he was ambitious of
maintaining himself and his sister in comfort.
This was a considerable sum for a newsboy to earn, and most
boys in our hero's position would have felt discouraged. But Rough
and Ready had an uncommon degree of energy and persistence,
and he resolutely determined that in some way the weekly sum
should be obtained. In some honest way, of course, for our hero,
though not free from faults, was strictly honest, and had never
knowingly appropriated a cent that did not justly belong to him. But
he was not averse to any method by which he might earn an honest
penny.
During the first fortnight after Rose came under the charge of Miss
Manning, the newsboy earned fifteen dollars. His expenses during
that time, including the amount paid for his sister, amounted to ten
dollars and a half. This left four dollars and a half clear. This sum
Rufus put into a savings-bank, knowing that after a time it would be
necessary to purchase clothing both for himself and his sister, and
for this purpose a reserve fund would be required.
One day, after selling his supply of morning papers, he wandered
down to the Battery. This, as some of my readers may need to be
informed, is a small park situated at the extreme point of Manhattan
Island. It was on a delightful promenade, covered with grass, and
shaded by lofty sycamore-trees. Around it formerly lived some of the
oldest and most aristocratic families in the city. But its ancient glory,
its verdure and beauty, have departed, and it is now unsightly and
neglected. None of its old attractions remain, except the fine view
which it affords of the bay, the islands, and fortifications, and the
opposite shores of New Jersey. The old families have moved far up-
town, and the neighborhood is given to sailors' boarding-houses,
warehouses, and fourth-rate hotels and bar-rooms.
The newsboy strayed into one of these bar-rooms, not with any
idea of drinking, for he never had been tempted to drink. The
example of his stepfather had been sufficient to disgust him with
intemperance. But it was an idle impulse that led him to enter. He
sat down in a chair, and took up a copy of the "Morning Herald," of
which he had sold a considerable number of copies, without having
had a chance to read it.
Chancing to cast his eyes on the floor, he saw a pocket-book. He
stooped down and picked it up, and slipped it into his pocket. He
looked about him to see if there was any one present that was likely
to have lost it. But, besides the bar-keeper, there was no one in the
room except a rough-looking laborer in his shirt-sleeves, and it was
evident that it did not belong to him, as he drew from his vest-
pocket the money with which he paid for his potation.
The newsboy concluded that the pocket-book belonged to some
patron of the bar, who had dropped it, and gone away without
missing it. The question came up, what should he do with it? Was it
his duty to hand it to the bar-keeper?
He decided that it was not. Bar-keepers are apt to have easy
consciences, and this one was not a very attractive representative of
his class. He would undoubtedly pocket the wallet and its contents,
and the true owner, if he should ever turn up, would stand very little
chance of recovering his money.
These reflections quickly passed through the mind of our hero,
and he decided to retain the pocket-book, and consult some one, in
whom he reposed confidence, as to the proper course to pursue. He
had no idea how much the wallet contained, and did not venture to
examine it while he remained where he was. He decided to ask Mr.
O'Connor, the superintendent of the Lodging House, what he had
better do under the circumstances.
"I will remain here awhile," thought Rough and Ready. "Maybe the
owner of the wallet will miss it, and come back for it. If he does, and
I am sure it is his, I will give it up. But I won't give it to the bar-
keeper; I don't like his looks."
So Rufus remained in his seat reading the "Herald." He had never
read the paper so faithfully before. While he was still reading, a
sailor staggered in. He had evidently been drinking before, and
showed the effects of it.
"A glass of rum," he said, in a thick voice.
"All right, sir," said the bar-keeper, obsequiously.
"I'm bound to have a jolly time," said the sailor. "I've just come
back from a voyage, and I mean to make the money fly while I have
it."
So saying, he drew out half-a-dozen bank-bills, rolled up tightly
together.
"That's the talk," said the bar-keeper, complaisantly. "Nothing like
being jolly."
"I say, you drink with me," said the sailor. "I don't want to drink
alone."
"Certainly, thank you;" and the bar-keeper poured out a glass for
himself.
"Isn't there anybody that would like a drink?" said the sailor.
He looked around him, and his glance fell on Rough and Ready.
"Won't that boy drink?" he asked.
"You had better ask him."
"I say, won't you have a drink?" said the sailor, turning to the
newsboy.
"No, I thank you," said the newsboy.
"Are you too proud to drink with a rough fellow like me?"
"No," said our hero; "but I never drink. I don't like it."
"Well, my lad, I don't know but you're right," said the sailor, more
soberly. "My mother asked me not to drink; but I couldn't hold out.
Don't do it, if you don't like it."
The bar-keeper by this time thought fit to interfere.
"Look here, boy," he said, angrily, "we don't want any temperance
lectures here. You've stayed as long as you're wanted. You needn't
come in here hurting our trade."
Rough and Ready did not think it necessary to answer this tirade,
but laid down the paper and went out, carrying the pocket-book with
him, of course. He did not open it, even after he got into the street,
for the action would be noticed, and it might excite suspicion if he
were seen counting over a roll of bills, which he judged from the
feeling the wallet contained.
It was now time to lay in his supply of afternoon papers, and he
therefore turned his steps to the offices, and was soon busily
engaged in disposing of them. Indeed, so busily was he occupied,
that he quite forgot he had the wallet in his possession. The papers
sold readily, and it was not till he was ready to go to supper with
Miss Manning and Rose that the thought of his discovery returned to
him.
"I will wait and open the pocket-book when I get to the room," he
said to himself.
"Well, Rose," he said, gayly, on entering the room, "what do you
think I've found?"
"I wish it was a kitten," said Rose.
"No, it isn't that," said Rufus, laughing, "and I don't think I should
take the trouble to pick it up, if I did find one."
"Do you like kittens, Rose?" asked Miss Manning.
"Yes, very much," said Rose; "they are so pretty and playful."
"Would you like to have me get one for you?"
"Will you?" asked the child, eagerly.
"Yes; there's a lodger on the lower floor has three. No doubt she
will give us one."
"But won't it trouble you, Miss Manning?" asked the newsboy. "If it
will, don't get it. Rose can get along without it."
"Oh, I like kittens myself," said Miss Manning; "I should really like
one."
"Now I like dogs best," said Rough and Ready.
"Most boys do, I believe," said the seamstress.
"But kittens are much prettier, Rufie," said Rose.
"They'll scratch, and dogs won't," said the newsboy; "but if you
like a kitten, and Miss Manning is kind enough to get you one, I shall
be glad to have her do so. But you seem to have forgotten all about
my discovery."
"What is it, Rufie?"
Rough and Ready drew the pocket-book from his pocket, and
displayed it.
"Where did you find it, Rufus?" asked Miss Manning.
"Is there much money in it, Rufie?" asked his sister.
"I don't know yet, I'll look and see, and afterwards I'll tell where I
found it."
He opened the wallet, and drew out a roll of bills. Spreading them
open, he began to count. To his surprise they proved to be bills of a
large denomination. There was one one-hundred-dollar bill, five
twenties, six tens, and eight fives. He raised his eyes in surprise.
"Why, here are three hundred dollars," he said.
"Three hundred dollars!" exclaimed Rose, clapping her hands.
"Why Rufie, how rich you are!"
"But it isn't my money, Rose," he said. "You must remember that.
I may find the owner."
"Oh, I hope you won't," said the little girl, looking disappointed.
"But it isn't right to wish that, Rose," said Miss Manning. "Suppose
you had lost the money, you would like to have it returned to you,