Starting Out with Java From Control Structures through Data Structures 3rd Edition Gaddis Test Bank download
Starting Out with Java From Control Structures through Data Structures 3rd Edition Gaddis Test Bank download
https://testbankdeal.com/product/starting-out-with-java-from-control-
structures-through-data-structures-3rd-edition-gaddis-test-bank/
https://testbankdeal.com/product/starting-out-with-java-from-control-
structures-through-data-structures-3rd-edition-gaddis-solutions-
manual/
https://testbankdeal.com/product/starting-out-with-java-from-control-
structures-through-data-structures-2nd-edition-gaddis-test-bank/
https://testbankdeal.com/product/starting-out-with-java-from-control-
structures-through-data-structures-2nd-edition-gaddis-solutions-
manual/
https://testbankdeal.com/product/absolute-c-6th-edition-savitch-test-
bank/
Criminal Justice Ethics Theory and Practice 4th Edition
Banks Test Bank
https://testbankdeal.com/product/criminal-justice-ethics-theory-and-
practice-4th-edition-banks-test-bank/
https://testbankdeal.com/product/biology-1st-edition-marielle-
hoefnagels-test-bank/
https://testbankdeal.com/product/medical-surgical-nursing-concepts-
and-practice-2nd-edition-dewit-test-bank/
https://testbankdeal.com/product/taxation-of-individuals-and-business-
entities-2015-6th-edition-spilker-test-bank/
https://testbankdeal.com/product/introduction-to-statistics-an-active-
learning-approach-2nd-edition-carlson-solutions-manual/
Operations Management Sustainability and Supply Chain
Management Canadian 3rd Edition Heizer Test Bank
https://testbankdeal.com/product/operations-management-sustainability-
and-supply-chain-management-canadian-3rd-edition-heizer-test-bank/
Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda)
Chapter 6 A First Look at Classes
2) Class objects normally have ________ that perform useful operations on their data, but primitive
variables do not.
A) fields
B) instances
C) methods
D) relationships
Answer: C
3) In the cookie cutter metaphor, think of the ________ as a cookie cutter and ________ as the cookies.
A) object; classes
B) class; objects
C) class; fields
D) attribute; methods
Answer: B
5) When you are working with a ________, you are using a storage location that holds a piece of data.
A) primitive variable
B) reference variable
C) numeric literal
D) binary number
Answer: A
1
Copyright © 2016 Pearson Education, Inc.
7) Most programming languages that are in use today are:
A) procedural
B) logic
C) object-oriented
D) functional
Answer: C
8) Java allows you to create objects of this class in the same way you would create primitive variables.
A) Random
B) String
C) PrintWriter
D) Scanner
Answer: B
10) Data hiding, which means that critical data stored inside the object is protected from code outside the
object, is accomplished in Java by:
A) using the public access specifier on the class methods
B) using the private access specifier on the class methods
C) using the private access specifier on the class definition
D) using the private access specifier on the class fields
Answer: D
2
Copyright © 2016 Pearson Education, Inc.
12) You should not define a class field that is dependent upon the values of other class fields:
A) in order to avoid having stale data
B) because it is redundant
C) because it should be defined in another class
D) in order to keep it current
Answer: A
16) A constructor:
A) always accepts two arguments
B) has return type of void
C) has the same name as the class
D) always has an access specifier of private
Answer: C
17) Which of the following statements will create a reference, str, to the String, "Hello, World"?
A) String str = "Hello, World";
B) string str = "Hello, World";
C) String str = new "Hello, World";
D) str = "Hello, World";
Answer: A
3
Copyright © 2016 Pearson Education, Inc.
18) Two or more methods in a class may have the same name as long as:
A) they have different return types
B) they have different parameter lists
C) they have different return types, but the same parameter list
D) you cannot have two methods with the same name
Answer: B
19) Given the following code, what will be the value of finalAmount when it is displayed?
4
Copyright © 2016 Pearson Education, Inc.
20) A class specifies the ________ and ________ that a particular type of object has.
A) relationships; methods
B) fields; object names
C) fields; methods
D) relationships; object names
Answer: C
21) This refers to the combining of data and code into a single object.
A) Data hiding
B) Abstraction
C) Object
D) Encapsulation
Answer: D
23) In your textbook the general layout of a UML diagram is a box that is divided into three sections. The
top section has the ________; the middle section holds ________; the bottom section holds ________.
A) class name; attributes or fields; methods
B) class name; object name; methods
C) object name; attributes or fields; methods
D) object name; methods; attributes or fields
Answer: A
5
Copyright © 2016 Pearson Education, Inc.
26) After the header, the body of the method appears inside a set of:
A) brackets, []
B) parentheses, ()
C) braces, {}
D) double quotes, ""
Answer: C
30) When an object is created, the attributes associated with the object are called:
A) instance fields
B) instance methods
C) fixed attributes
D) class instances
Answer: A
31) When an object is passed as an argument to a method, what is passed into the method's parameter
variable?
A) the class name
B) the object's memory address
C) the values for each field
D) the method names
Answer: B
6
Copyright © 2016 Pearson Education, Inc.
32) A constructor is a method that:
A) returns an object of the class.
B) never receives any arguments.
C) with the name ClassName.constructor.
D) performs initialization or setup operations.
Answer: D
34) Which of the following statements will create a reference, str, to the string, "Hello, world"?
7
Copyright © 2016 Pearson Education, Inc.
36) Given the following code, what will be the value of finalAmount when it is displayed?
8
Copyright © 2016 Pearson Education, Inc.
38) Instance methods do not have this key word in their headers:
A) public
B) static
C) private
D) protected
Answer: B
39) Which of the following is NOT involved in finding the classes when developing an object-oriented
application?
A) Describe the problem domain.
B) Identify all the nouns.
C) Write the code.
D) Refine the list of nouns to include only those that are relevant to the problem.
Answer: C
41) Quite often you have to use this statement to make a group of classes available to a program.
A) import
B) use
C) link
D) assume
Answer: A
import java.util.Scanner;
This is an example of
A) a wildcard import
B) an explicit import
C) unconditional import
D) conditional import
Answer: B
9
Copyright © 2016 Pearson Education, Inc.
43) Look at the following statement.
import java.util.*;
44) The following package is automatically imported into all Java programs.
A) java.java
B) java.default
C) java.util
D) java.lang
Answer: D
4) A method that stores a value in a class's field or in some other way changes the value of a field is
known as a mutator method.
Answer: TRUE
7) Shadowing is the term used to describe where the field name is hidden by the name of a local or
parameter variable.
Answer: TRUE
8) The public access specifier for a field indicates that the attribute may not be accessed by statements
outside the class.
Answer: FALSE
9) A method that gets a value from a class's field but does not change it is known as a mutator method.
Answer: FALSE
10
Copyright © 2016 Pearson Education, Inc.
10) Instance methods do not have the key word static in their headers.
Answer: TRUE
11) The term "default constructor" is applied to the first constructor written by the author of a class.
Answer: FALSE
12) When a local variable in an instance method has the same name as an instance field, the instance field
hides the local variable.
Answer: FALSE
13) The term "no-arg constructor" is applied to any constructor that does not accept arguments.
Answer: TRUE
14) The java.lang package is automatically imported into all Java programs.
Answer: TRUE
11
Copyright © 2016 Pearson Education, Inc.
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of Basil and
Annette: A Novel
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.
Author: B. L. Farjeon
Language: English
A Novel.
By B. L. FARJEON,
AUTHOR OF "GREAT PORTER SQUARE," "TOILERS OF BABYLON,"
"A YOUNG GIRL'S LIFE," "THE MYSTERY OF M. FELIX," &c.
IN ONE VOLUME.
LONDON:
F. V. WHITE & CO.,
31, SOUTHAMPTON STREET, STRAND, W.C.
1891.
PRINTED BY
KELLY AND CO., GATE STREET, LINCOLN'S INN FIELDS W.C.,
AND KINGSTON-ON-THAMES.
CONTENTS.
CHAPTER I.
CHAPTER II.
CHAPTER III.
CHAPTER IV.
CHAPTER V.
CHAPTER VI.
CHAPTER VII.
CHAPTER VIII.
CHAPTER IX.
CHAPTER X.
CHAPTER XI.
CHAPTER XII.
CHAPTER XIII.
CHAPTER XIV.
CHAPTER XV.
CHAPTER XVI.
CHAPTER XVII.
CHAPTER XVIII.
CHAPTER XIX.
CHAPTER XX.
CHAPTER XXI.
CHAPTER XXII.
CHAPTER XXIII.
CHAPTER XXIV.
CHAPTER XXV.
CHAPTER XXVI.
CHAPTER XXVII.
CHAPTER XXVIII.
CHAPTER XXIX.
CHAPTER XXX.
CHAPTER XXXI.
CHAPTER XXXII.
CHAPTER XXXIII.
CHAPTER XXXIV.
CHAPTER XXXV.
CHAPTER XXXVI.
CHAPTER XXXVII.
CHAPTER XXXVIII.
CHAPTER XXXIX.
CHAPTER XL.
CHAPTER XLI.
CHAPTER XLII.
CHAPTER XLIII.
CHAPTER XLIV.
CHAPTER I.
In the old world the reign of winter has commenced. The woods
are snow-white, the hedges are frosted over, the pools are frozen,
icicles hang from the branches of the trees. Wayfarers walk briskly,
stamp their feet, and beat their hands to keep the circulation going;
while other humans, whom business does not call from their houses,
snuggle round the fireside, with doors and windows closed to keep
out the nipping air. Winged immigrants that came in the sweet
spring days have long since taken their departure to warmer climes,
bearing with them memories of a bright youth, to be renewed when
another spring smiles upon the land.
He promised to obey her, but it was not until many years had
passed that he knew what she meant when she told him to counsel
and guide his father. It was she who had steered her husband's boat
when it had got into troubled waters, and steered it always into a
safe harbour. No one knew it, no one suspected it; not even her
husband, who believed that it was due to himself alone that he
escaped dangers which threatened him from time to time; but this
ignorance was due to her wisdom, and partly, also, to her love;
rather than wound his feelings, she preferred to suffer herself. It is
not to be inferred from this remark that she had not led a happy life;
she had, and her home was happy in the truest sense; but she
sighed to think of her husband, left alone to grapple with difficulties
which his easy nature prevented him from seeing.
She had a private fortune of her own, and with her husband's
consent she made a will devising it all to her son, with the exception
of some small legacies to humble friends. The money was to be
invested, and to accumulate till Basil was twenty-one years of age,
when he was to come into possession of it; so that, even without his
uncle, he was comfortably provided for. A short time after his
mother's death, his father announced his intention of giving up his
establishment in the country and settling in London. The home in
which he had passed so many happy years with his wife was
desolate and sad now that she was gone from it; he wandered
through the rooms with a weight on his heart which memory made
heavier instead of lighter.
"Yes Basil," he said to his son, "it is the best thing I can do. If I
remain here I shall lose my reason; I must find some distraction
from grief."
Basil was too young to question this decision; what his father
resolved upon must be right. The old home was sold up, and father
and son removed to London. Then came the question of Basil's
education. His uncle considered removal to London a step in the
wrong direction, and he wrote to that effect; he also expressed his
opinion that London was an unsuitable place in which to conduct a
young gentleman's education. "Give the lad a tutor," he said, "and
let him travel." This was done, and before he was fifteen years of
age Basil was living on the Continent, picking up knowledge and
picking up pleasure in not quite equal quantities, the latter
predominating. It was an agreeable life, and Basil did not harm by it.
Every year he came to England, and spent a month with his father in
London and a week with his uncle in the country. On one occasion
he and his uncle spent this week together in the great city, living at
Morley's Hotel, Charing Cross, and seeing the sights, and this visit
was destined to be pregnant with strange results in years to come.
Except upon all other occasions the uncle received Basil in the
country. The old gentleman was full of quips and cranks and
imaginary ills. He fancied himself an invalid, and coddled himself up
absurdly; and Basil, when he visited him, seldom left the house. The
forced seclusion did not trouble the young fellow; he could make
himself happy anywhere. Certainly there were few dull moments in
his uncle's house when Basil was in it, and the old gentleman, while
not objecting to a display of animal spirits, improved the opportunity
by endeavouring to drive into his nephew's head a special kind of
worldly wisdom. As, for instance: All men are rogues (ourselves
excepted). Never open your heart to a friend (except to an uncle
who is going to leave you all his money). Keep your secrets. Spend
your money on your own pleasures and your own ambitions. Never
make yourself responsible for another man's debts. Et cetera, et
cetera, et cetera. This kind of counsel was showered upon Basil, and
produced no effect upon him whatever; he was spared the trouble of
arguing upon these matters, even if he were in the humour for it--
which he was not; he had a knack of avoiding disagreeable topics by
his uncle's everlasting assertion that the counsel he gave was
absolutely indisputable, and was to be received as such.
"All right, uncle," said Basil; "now let us talk of something else."
"And when you write it," his uncle Said, "burn it. Write a book
indeed! Put your time out at better interest, Basil. Make money,
money, money. Then people will bow down to you. I'm not a nice
object to look at, am I? But I've got money, and people bow down to
me! How much more will they be likely to do so to a handsome
fellow like you? Make money, my boy, make money, and stick to it."
Which worldly advice went as usual in at one ear and out at the
other. After all, the old gentleman's remarks had only a general
application; had there been any special interest at stake Basil would
have argued it stoutly enough, and thereby got himself into hot
water.
Between him and Basil there had never been a harsh word. Each
bore for the other the truest affection. Never a cross, never an ill-
tempered look; unvarying sweetness had marked their intercourse.
So sudden a separation could have been nothing less than terrible to
the living. It was long before Basil recovered from it. With the
exception of his crotchety old uncle he was absolutely without kith or
kin. Letters had passed between them with reference to the sad
event. "I cannot come to London to attend the funeral," his uncle
wrote; "I am too infirm and feeble. When you have settled your
father's affairs I shall be glad to see you to talk things over. It is time
you made a serious start in life. You have your mother's fortune, and
your father's, which I should say is a handsome one; you will have
mine, though I intend to keep you out of it as long as I can. You are
a lucky dog; you ought to die a millionaire." A mortal ending the
absolute desirability of which may well be doubted. Basil replied,
hoping his uncle would live to a good old age, and promising to visit
him as soon as affairs were settled. In his father's desk he found the
scrawl which the dying man had written. It was very short.
It was not until the day after the funeral that the significance of
these words impressed itself on Basil. "The honour of my name is in
your hands." They were his father's last words to him. What
meaning did they bear? He had heard from his father's lawyers,
informing him that they had the will in their possession, and that
they were at his service. He wrote to them, to the effect that he
would call upon them early the following morning.
The head of the firm received him gravely and courteously, and
gave orders that they were not to be disturbed.
The will had been drawn out years since, and no alteration had
been made in it. Everything was left to Basil, unreservedly to him.
There were affectionate allusions in it which drew tears from Basil's
eyes. When this emotion had subsided he observed that the lawyer
was regarding him with an air of curiosity.
"May I ask," said the lawyer, "if full confidence existed between
you and your father?"
"The fullest," replied Basil. "He had no secrets from me, nor I any
from him."
The lawyer seemed sensibly relieved. "You know of his
speculations?"
"Then full confidence did not exist between you. I warned him; I
could do no more than that. In my experience, my dear sir, I have
seen so many go the same way. There is but one end to it, and this
has ended as the others have done."
"Claims are pouring in. If they are satisfied, the will in your hands
is not worth more than waste paper. But some of the claims may be
contested, and in my belief successfully. But that will be a matter for
counsel's opinion."
"It has nothing to do with counsel," said Basil; "it has to do with
me. I am my dear father's representative, and it is for me to
determine what is to be done."
"Yes."
"Plainly, then," said the lawyer, "the property your father has left
will not be sufficient to meet his debts."
"Yes," said Basil, rising and pacing the room in his excitement,
"they must be paid. No stigma must rest upon my father's memory.
Some of the claims may be contested, you say? In justice?"
"At least," said Basil, "you can answer me this question. My father
owes the money?"
"But," said the lawyer, eyeing the young man as he would have
eyed a psychological puzzle, "if the estate left by your father is not
sufficient to satisfy all these claims, what is to be done?"
"Will that," asked Basil, "with my father's estate, satisfy in full the
claims which are pouring in?"
Basil would not allow him to conclude. "I have to repeat some of
my questions, it seems," he said. "Will this fortune, which is
realisable in an hour, satisfy in full the claims of my father's
creditors?"
The lawyer shrugged his shoulders, and replied briefly, "More than
satisfy them."
"Then the matter is settled," said Basil. "I empower you to collect
the whole of these claims to the uttermost farthing; to convert the
securities which are mine into money; to prepare a complete balance
sheet, and to pay my father's creditors in full, with as little delay as
possible."
"Good morning, my dear sir," said the lawyer, adding under his
breath, "and I am greatly astonished at you."
"Nephew Basil" (the letter ran), "I have received news of your
mad proceedings since your return home. No person in his sober
senses would have acted as you have done. The greater portion of
the claims made against your father's estate could have been legally
and successfully contested, and even in what remained a sharp
lawyer could have obtained a substantial abatement. This view, as I
understand, was presented to you by an able firm of solicitors, but
you rejected it, and chose to play the fool. Now, I do not care to
have dealings with a fool.
"I might have pardoned you for sacrificing your father's estate to
satisfy these claims, but I will not pardon you for sacrificing the
fortune your mother left you. It proves to me that it is not safe to
entrust money to you, and I have decided to put mine to better use
than to leave it to you. Accept this intimation as my ultimatum. It is
the last letter you will ever receive from me, and you will never see
me again. Therefore you need not go to the trouble of coming my
way. My house is not open to you. All the good counsel I have given
you has been thrown away. You might have told me at the time and
I should have saved my breath and my patience. Good-bye, foolish
nephew.
"Bartholomew Whittingham."
"As you are so fond of paying debts for which you are not
responsible, what do you say to considering the money I have given
you from time to time as one, and handing it back? You can do as
you please about it. I can make no legal demand for it, but I gave it
to you under the impression that you were not exactly an idiot. It
amounts to quite fourteen hundred pounds. If I had it I would put it
out at good interest."
To state that Basil was not hurt by this letter would be to state
what is not true. He had an affection for the old fellow, and he was
greatly pained to think that all was over between them; but he was
not in the least disturbed by the old man's arguments. He had done
what was right; of this he was sure. But the letter stung Basil as well
as hurt him. There was a bitter twang in his uncle's remark that he
could make no legal demand for the money he had given his
nephew. "He shall have it back," said Basil, "every farthing of it."
Then he was seized with an expensive fit of humour. His uncle had
spoken of interest. He would prove that he was not a whit less
independent than the old fellow himself. He made some lame and
ridiculous calculations of interest at five per cent, per annum, and
arrived at the sum of two thousand pounds and a few pence. He got
a draft for the amount, and inclosed it in the following note:--
"All right, my dear uncle. Here is your money back again, with
interest added. If it is not enough interest, let me know, and I will
send you more. Good-bye, and good luck to you.
"Basil."
This last debt paid, Basil had barely a thousand pounds left. He
did not hear from his uncle again.
CHAPTER II.
He had neither sought nor made friends, he and his wife and child
had been sufficient for each other, and when his wife died he and
Annette sighed for no other companionship. But had he sought
friendships he would not have succeeded in making them in any but
fitful fashion. His nearest neighbour was twenty miles away, and
everybody in the colony was so intent upon "getting on" and making
his fortune, that there was no time for social intercourse. In colonial
cities there was at that time but little "society;" in the bush, none.
About a hundred feet above the blue clear stream of the Pioneer
stood the house in which Anthony Bidaud lived. The slabs with which
it was built had been split from the gum and bloodwood trees
growing in the forest which lay in the rear of the huts and buildings
inhabited by the labourers, chiefly South Sea Islanders, who worked
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
testbankdeal.com