Starting Out with Java From Control Structures through Data Structures 3rd Edition Gaddis Test Bank instant download
Starting Out with Java From Control Structures through Data Structures 3rd Edition Gaddis Test Bank instant 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.
Visit https://testbankdead.com
now to explore a rich
collection of testbank,
solution manual and enjoy
exciting offers!
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.
Other documents randomly have
different content
Some probably regarded this as clever; others may have deemed it
impertinent, if not impudent, and doubtless among these latter was included
the Empress Elisabeth, who often manifested her friendly feeling for her
sister-Sovereign. Let us, however, be perfectly just and fair to the Austrian
Ambassadress. She was admittedly more than a little méchante; but it
should not be forgotten that she induced some of the most brilliant and
beautiful women of the time to attend the Empress’s Court, and that but for
her the Palace might never have seen within its walls such grandes dames as
the Princesse de Sagan, the Comtesse de Pourtalès, the Comtesse de
Beaumont, Mme. de Canisy, e tutti quanti. If she was as “ugly as a
monkey,” she was at least, “spirituelle comme un démon et bonne comme
un ange,” the most radiant star of the constellation of pretty women which
graced the Tuileries.
Thérèsa, who was dubbed, very irreverently, “the music-hall Patti,”
interpreted what later were styled “les chansons rosses,” and Mme. de
Metternich was blamed, not altogether unjustly, for having introduced into
the salons a singer and reciter of impertinent “comic” effusions only to be
heard in the cafés-concerts. By most people Thérèsa’s ditties were regarded
as highly diverting; others considered them “impossible,” and calculated to
lower the public taste.
Mme. de Metternich’s presence in Paris certainly gave an impetus to the
reviving fashionable movement. On all sides there were receptions and
other entertainments, to the complete satisfaction of the tradespeople.
Among the frequenters of the official salons were to be found many young
men from the Government offices who were something more than good
dancers. Many of them had a future; some attained success, and some came
to the ground when their fortunes appeared to be brightest. One of these
latter was young Soubeyran, who reached a high position under M. Achille
Fould, Minister of Finance. He was a grandson of Savary, Duc de Rovigo,
and experienced all the vicissitudes of fortune. Luckily he had a wife
(daughter of the Marquis de Saint-Aulaire) who remained devoted to him in
his darkest hours. Before he became almost the greatest financier during the
reign of Napoleon III., Soubeyran (who, in many respects, was a man of the
Albert Grant type, although, unlike the English speculator, he was “born”)
had joined the Crédit Foncier as Deputy-Governor, his chief being M.
Frémy. The latter retired, and Soubeyran stepped into his shoes.
Unfortunately for himself, Soubeyran embroiled the Crédit Foncier so
deeply in the affairs of the Egyptian Debt that the Government removed
him from his position, and ordered him to pay his successors 40,000,000
francs, although later it was recognized that Soubeyran’s methods were
highly beneficial to the country! Soubeyran, whose figure remains
legendary in the world of la haute finance, was not, however, even then,
completely “broke.” He started afresh, founded two large banks, and lived
in sumptuous style; then he involved himself in dealings in the Italian rente,
and fell, never to rise again, dragging down with him all who had believed
in his “star.”
It was a moment in the reign when the Bourse and the great banks joined
in a vast development of commercial undertakings, among them the
magasins of the “Louvre,” inaugurated in 1855, and viewed rather
sceptically by some of the leading financiers, who did not rush to invest
their capital in the huge drapery business of MM. Hériot and Chauchart.[74]
They had been employés, without any other advantages but those accruing
from exceptional intelligence and untiring industry, and they found their
patrons among the tout Paris of the Second Empire. Of course, the success
of Hériot and Chauchart led to imitators of their methods, and ere many
years had elapsed there arose similar immense “stores”—“Lafayette,”
“Dufayel,” the “Printemps,” and others. It was in the reign of Napoleon III.
that the “Bon Marché” sprang up in what had been one of the quietest
quarters of Paris.[75] The Emperor saw with supreme satisfaction the
creation and rapid progress of these establishments, the success of which
spelt ever-increasing national prosperity.
Of the “fast” set—composed of men of all ages—the most conspicuous
was the Duc de Grammont-Caderousse.[76] A fair-complexioned man, of
average height, with small moustache and reddish whiskers, small head, and
an abnormally long neck, circled by a straight collar, his high cheek-bones,
sunken face, slightly rouged, and cavernous voice, evidenced the existence
of phthisis. There were few more brilliant talkers even among the men of
letters whose society he affected—Aurélien Scholl, Théodore Barrière,
d’Anatole de la Forge, Jules Noriac, and Alphonse Cayron, to name only a
few. Despite the English cut of his clothes, he was a Frenchman to his
finger-tips. Some of the achievements of the notable viveur whom the
Duchesse de Persigny christened “le Duc Darling” may be summarized. He
had much to do with the bringing-out of Hortense Schneider, the creator of
the principal character in Offenbach’s “La Grande Duchesse de Gérolstein.”
He jumped his horse over a dining-table covered with Sèvres—a freak
which cost him a small fortune. “Rigolboche,” the notorious dancer of the
“cancan,” won the considerable bet which he made with her that she would
not, in broad daylight, cross the boulevard from the Café Anglais to the
Maison Dorée in Nature’s own garb. “He lit his cigar on La Marche
steeplechase course with an English thousand-pound bank-note (which he
had just won), because the rustling of the crisp paper grated on his nerves.
He gave Cora Pearl[77] the famous silver bath-tub, filled it with magnums
of champagne, and then got into it before the amazed company. A few hours
before his death he gave a farewell supper-party, made his friends very
drunk, and then, very quietly and without a struggle, expired before they
had time to get sober. Had Caderousse been properly brought up he might
have made a name for himself, but he frittered away his existence and died,
as he had lived, like a clever clown. He had the best opinion of himself, or,
when Paul Demidoff[78] once asked him to take the head of the table at a
dinner-party, he would not have replied: ‘The head of the table is wherever
De Grammont-Caderousse sits.’ ”[79]
It was only when the Second Empire began to dazzle the world—the
new as well as the old—that the foreign colony of Paris assumed
importance. During the previous quarter of a century the société étrangère
consisted mainly of rich bachelors, English and Russian, like the Marquis of
Hertford, Lord Seymour, Prince Mentschikoff, and Comte Rostopchine.
There were, however, a few distinguished ladies, the most notable being the
two Russians—the Princesse de Lieven,
MRS. RONALDS.
One of their Majesties’ guests at the Palace of the
Tuileries.
A private photograph, lent for this work
by Mrs. Ronalds.
To face p. 52.
was not to be found. “You must have been robbed,” said the Marquis; “but
never mind—I must get you another like it.”
A week or so later he again entered his wife’s room in the morning, and
nonchalantly inquired if the ruby bracelet had been found. “No,” replied the
Marquise innocently, “of course not, or I should have told you.” “Oh,
‘Cochonette,’ ” laughingly exclaimed the hero of Puebla; then, taking her
by the hand, he led her to the washing-stand, which closed with a lid to
keep out the dust. Lifting the cover, he showed his bewildered spouse the
bracelet lying in the basin, where he had put it on the night he had gone into
her bedroom after the Tuileries ball! A week without a visit to the hand-
basin was (said Caderousse) proved against the Marquise by this trick; for,
had she lifted the cover, she would have found her missing bracelet.
The imperial couple would have readily admitted, had they been asked,
that they had no better friend, and that France did not possess a more
patriotic soul, than the Comtesse de Pourtalès (who was born Mélanie de
Bussière), who was always most warmly welcomed by the Emperor and
Empress at the Tuileries entertainments, at the chasses and theatricals at
Compiègne, and wherever else their Majesties happened to be. In that
beautiful house in the Rue Tronchet, a museum and gallery of art combined,
were to be found many English who were in Paris in obedience to the
imperial invitation, the Prince of Wales not seldom being among them. It
was Mme. de Pourtalès who, upon her return to Paris from a visit to Berlin,
warned the Emperor and Empress of the high state of efficiency of the
German forces. But she only had her trouble for her pains. The self-satisfied
Generals made light of her forebodings of evil. Only Colonel Stöffel
listened to her sympathetically, for he, better than anybody, knew how right
she was. Who does not remember the portrait of Mme. de Pourtalès, garbed
à l’Alsacienne, which, when France was humbled to the dust, evoked
emotion all over the world? Who can forget the practical help which she
hastened to extend to the Empress after her flight from the Tuileries?
At the amateur theatricals at Compiègne none of the ladies outshone the
Comtesse de Pourtalès. In the Marquis de Massa’s Revue de l’année 1867
she represented the River Seine, magnificently dressed, of course. A phrase,
sublime in its audacity, was put into her mouth, and was delivered with such
charming naïveté that the little theatre resounded with peals of laughter.
Prudhomme (Baron Lambert) exclaimed rapturously, “Mais, quel superbe
costume vous avez, belle dame!” a compliment to which Mme. de Pourtalès
had to reply, “Oh, j’en ai un beaucoup plus beau par-dessous!” (I have a
much more beautiful one underneath.)
In the last years of the reign there figured at the Court of the Tuileries
(and equally in the Royalist salons of the Faubourg Saint-Germain), among
the pléiade of dazzling forms, the Baronne Alphonse de Rothschild.[84] The
hôtel of the Baron and Baroness Alphonse in the Rue St. Florentin, which
had been acquired from the heirs of the Prince de Talleyrand, was not only
the rendezvous of the brilliant society of the Second Empire and of the
intransigeante aristocracy of the ancien régime, but frequently opened its
doors to foreign Princes, who, with lesser mortals, were also entertained at
the magnificent château of Ferrières (a landmark in 1870-71) and at the
fairy-like home at Cannes. Like the other (Continental) Rothschilds, the
Baron and Baroness Alphonse liked to be surrounded by the artistic
element. In their Paris hôtel were to be seen the leading lights of literature,
science, and art. Of course, the Baron and Baroness were what is called
“keen” on every kind of sport, otherwise they would not have been
Rothschilds. Alexandre Dumas fils, calling on the Baroness Alphonse one
Monday afternoon, was met with the inquiry: “Well, Monsieur Dumas,
were you at the races yesterday?” “At the races, Madame la Baronne! Oh
no; I never go to them.” “Never go to the races!” exclaimed the Baroness,
surprised, if not horrified, at such an avowal; “then what on earth do you do
with yourself on Sundays?”[85]
Mme. de Courtval was well known to the Court coterie, as any intimate
friend of the Princesse de Sagan was bound to be. After dinner one night, at
her villa at Deauville, she and her guests sat down at the whist-table.
Presently there was a loud knocking and ringing at the door of the villa,
and, to the dismay of the servants, a much-whiskered and moustached
gentleman forced his way into the salon. Questioned as to his right to
intrude upon the privacy of Mme. de Courtval and her guests—the Prince of
Wales included—the stranger, in very aggressive tones, replied, “I have the
honour to be the Mayor of Deauville!” and, unbuttoning his overcoat, he
displayed to the stupefied party his scarf of office. He apologized for having
to discharge a painful duty, and proceeded to say that the fair hostess, by
permitting card-playing, had converted her villa into a tripot, or gaming-
house, and had brought herself within the meshes of the law. The farce
continued for some little time, to the great amusement of “the Prince” and
Mme. de Sagan, who were the only members of the party in the secret.
Then the whiskers of “M. le Maire” fell off, and revealed the features of a
gentleman who was well known to the hostess and her friends. To complete
the story, it must be added that the joke which had so perturbed Mme. de
Courtval and most of her guests was due to the ingenuity of the Princesse
de Sagan and—the Prince of Wales!
I pass from the recital of these frivolities to the Tragic Year. We shall see
precisely how the Empress fulfilled the duties of the Regency, and hear the
conversations of the Sovereigns.
CHAPTER XII
testbankdeal.com