Java How To Program Late Objects 10th Edition Deitel Test Bank pdf download
Java How To Program Late Objects 10th Edition Deitel Test Bank pdf download
https://testbankdeal.com/product/java-how-to-program-late-
objects-10th-edition-deitel-test-bank/
https://testbankdeal.com/product/java-how-to-program-late-
objects-10th-edition-deitel-solutions-manual/
https://testbankdeal.com/product/java-how-to-program-early-
objects-10th-edition-deitel-test-bank/
https://testbankdeal.com/product/java-how-to-program-early-
objects-10th-edition-deitel-solutions-manual/
https://testbankdeal.com/product/congress-and-its-members-16th-
edition-davidson-test-bank/
Clinical Nursing Skills 8th Edition Smith Test Bank
https://testbankdeal.com/product/clinical-nursing-skills-8th-edition-
smith-test-bank/
https://testbankdeal.com/product/essentials-of-federal-
taxation-2017-8th-edition-spilker-solutions-manual/
https://testbankdeal.com/product/think-marketing-3rd-edition-tuckwell-
solutions-manual/
https://testbankdeal.com/product/biology-9th-edition-raven-test-bank/
https://testbankdeal.com/product/law-for-business-12th-edition-barnes-
solutions-manual/
Chapter 10: Object-Oriented
Programming: Polymorphism
Section 10.1 Introduction
10.1 Q1: Polymorphism enables you to:
a. program in the general.
b. program in the specific.
c. absorb attributes and behavior from previous classes.
d. hide information from the user.
Ans: a. program in the general.
© Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc.
Section 10.3 Demonstrating Polymorphic
Behavior
10.3 Q1: Which statement best describes the relationship between superclass and
subclass types?
a. A subclass reference cannot be assigned to a superclass variable and a superclass
reference cannot be assigned to a subclass variable.
b. A subclass reference can be assigned to a superclass variable and a superclass
reference can be assigned to a subclass variable.
c. A superclass reference can be assigned to a subclass variable, but a subclass
reference cannot be assigned to a superclass variable.
d. A subclass reference can be assigned to a superclass variable, but a superclass
reference cannot be assigned to a subclass variable.
Ans: d. A subclass reference can be assigned to a superclass variable, but a
superclass reference cannot be assigned to a subclass variable.
10.5 Q2: If the superclass contains only abstract method declarations, the
superclass is used for ________.
a. implementation inheritance.
b. interface inheritance.
c. Both.
d. Neither.
Ans: b. interface inheritance.
10.5.1 Q1: Which of the following could be used to declare abstract method
method1 in abstract class Class1 (method1 returns an int and takes no arguments)?
a. public int method1();
b. public int abstract method1();
c. public abstract int method1();
d. public int nonfinal method1();
Ans: c. public abstract int method1();
10.5.1 Q2: Which of the following statements about abstract superclasses is true?
a. abstract superclasses may contain data.
b. abstract superclasses may not contain implementations of methods.
c. abstract superclasses must declare all methods as abstract.
d. abstract superclasses must declare all data members not given values as
abstract.
Ans: a. abstract superclasses may contain data.
(No questions.)
10.5.6 Q2: Every object in Java knows its own class and can access this information
through method .
a. getClass.
b. getInformation.
c. objectClass.
d. objectInformation.
Ans: a. getClass.
10.7 Q2: All of the following methods are implicitly final except:
a. a method in an abstract class.
b. a private method.
c. a method declared in a final class.
d. static method.
Ans: a. a method in an abstract class.
10.9 Q2: Which of the following does not complete the sentence correctly?
© Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc.
An interface .
a. forces classes that implement it to declare all the abstract interface methods.
b. can be used in place of an abstract class when there is no default implementation
to inherit.
c. is declared in a file by itself and is saved in a file with the same name as the
interface followed by the .java extension.
d. can be instantiated.
Ans: d. can be instantiated.
10.9.4 Q1: A class that implements an interface but does not declare all of the
interface’s methods must be declared ________.
a. public.
b. interface.
c. abstract.
d. final.
Ans: c. abstract.
© Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc.
ANS: a. References to interface types do not have access to method toString.
Actually, all references, including those of interface types, refer to objects that
extend Object and therefore have a toString method.
© Copyright 1992-2015 by Deitel & Associates, Inc. and Pearson Education, Inc.
Visit https://testbankdead.com
now to explore a rich
collection of testbank,
solution manual and enjoy
exciting offers!
Random documents with unrelated
content Scribd suggests to you:
people might come, leaving their canoes where such inlet
terminated.
They did not appear to have among them any government or
subordination: none was more respected than another; yet they
seemed to live together in the utmost harmony and good fellowship.
Neither did we discover any appearance of religion among them,
except the noises which have been mentioned, and which we
supposed to be a superstitious ceremony, merely because we could
refer them to nothing else: they were used only by one of those who
came on board the ship, and the two who conducted Mr. Banks and
Dr. Solander to the town, whom we therefore conjectured to be
priests. Upon the whole, these people appeared to be the most
destitute and forlorn, as well as the most stupid, of all human
beings; the outcasts of nature, who spent their lives in wandering
about the dreary wastes, where two of our people perished with cold
in the midst of summer; with no dwelling but a wretched hovel of
sticks and grass, which would not only admit the wind, but the snow
and the rain; almost naked; and destitute of every convenience that
is furnished by the rudest art, having no implement even to dress
their food: yet they were content. They seemed to have no wish for
any thing more than they possessed, nor did any thing that we
offered them appear acceptable but beads, as an ornamental
superfluity of life. What bodily pain they might suffer from the
severities of their winter we could not know; but it is certain that
they suffered nothing from the want of the innumerable articles
which we consider not as the luxuries and conveniencies only but
the necessaries of life: as their desires are few, they probably enjoy
them all; and how much they may be gainers by an exemption from
the care, labour, and solicitude, which arise from a perpetual and
unsuccessful effort to gratify that infinite variety of desires which the
refinements of artificial life have produced among us, is not very
easy to determine: possibly this may counterbalance all the real
disadvantages of their situation in comparison with ours, and make
the scales by which good and evil are distributed to man hang even
between us.
In this place we saw no quadruped except seals, sea-lions, and
dogs: of the dogs it is remarkable that they bark, which those that
are originally bred in America do not. And this is a further proof, that
the people we saw here had, either immediately or remotely,
communicated with the inhabitants of Europe. There are, however,
other quadrupeds in this part of the country; for when Mr. Banks
was at the top of the highest hill that he ascended in his expedition
through the woods, he saw the footsteps of a large beast imprinted
upon the surface of a bog, though he could not with any probability
guess of what kind it might be.
Of land-birds there are but few: Mr. Banks saw none larger than
an English blackbird, except some hawks and a vulture; but of
water-fowl there is great plenty, particularly ducks. Of fish we saw
scarce any, and with our hooks could catch none that was fit to eat;
but shell-fish, limpets, clams, and mussels, were to be found in
abundance.
Among the insects, which were not numerous, there was neither
gnat nor musquito, nor any other species that was either hurtful or
troublesome, which perhaps is more than can be said of any other
uncleared country. During the snow-blasts, which happened every
day while we were here, they hide themselves; and the moment it is
fair they appear again, as nimble and vigorous as the warmest
weather could make them.
Of plants, Mr. Banks and Dr. Solander found a vast variety; the far
greater part wholly different from any that have been hitherto
described. Besides the birch and winter’s bark, which have been
mentioned already; there is the beach, Fagus antarcticus, which, as
well as the birch, may be used for timber. The plants cannot be
enumerated here; but as the scurvy-grass, Cardamine
antiscorbutica, and the wild celery, Apium antarcticum, probably
contain antiscorbutic qualities, which may be of great benefit to the
crews of such ships as shall hereafter touch at this place, the
following short description is inserted:
The scurvy-grass will be found in plenty in damp places, near
springs of water, and, in general, in all places that lie near the
beach, especially at the watering-place in the Bay of Good Success:
when it is young, the state of its greatest perfection, it lies flat upon
the ground, having many leaves of a bright green, standing in pairs
opposite to each other, with a single one at the end, which generally
makes the fifth upon a foot-stalk. The plant, passing from this state,
shoots up in stalks that are sometimes two feet high, at the top of
which are small white blossoms, and these are succeeded by long
pods: the whole plant greatly resembles that which in England is
called Lady’s smock, or Cuckow-flower. The wild celery is very like
the celery in our gardens, the flowers are white, and stand in the
same manner, in small tufts at the top of the branches, but the
leaves are of a deeper green. It grows in great abundance near the
beach, and generally upon the soil that lies next above the spring
tides. It may, indeed, easily be known by the taste, which is between
that of celery and parsley. We used the celery in large quantities,
particularly in our soup, which, thus medicated, produced the same
good effects which seamen generally derive from a vegetable diet,
after having been long confined to salt provisions.
On Sunday the 22d of January, about two o’clock in the morning,
having got our wood and water on board, we sailed out of the bay,
and continued our course through the Streight.
CHAP. VI.
A lmost all writers who have mentioned the island of Terra del
Fuego, describe it as destitute of wood, and covered with snow. In
the winter it may possibly be covered with snow, and those who saw
it at that season might, perhaps, be easily deceived, by its
appearance, into an opinion that it was destitute of wood. Lord
Anson was there in the beginning of March, which answers to our
September, and we were there the beginning of January, which
answers to our July; which may account for the difference of his
description of it from ours. We fell in with it about twenty-one
leagues to the westward of the Streight of Le Maire, and from the
time that we first saw it, trees were plainly to be distinguished with
our glasses: and as we came nearer, though here and there we
discovered patches of snow, the sides of the hills and the sea coast
appeared to be covered with a beautiful verdure. The hills are lofty,
but not mountainous, though the summits of them are quite naked.
The soil in the valleys is rich, and of a considerable depth: and at the
foot of almost every hill there is a brook, the water of which has a
reddish hue, like that which runs through our turf bogs in England;
but it is by no means ill tasted, and, upon the whole, proved to be
the best that we took in during our voyage. We ranged the coast to
the Streight, and had soundings all the way from forty to twenty
fathom upon a gravelly and sandy bottom. The most remarkable
land on Terra del Fuego is a hill in the form of a sugar-loaf, which
stands on the west side not far from the sea; and the three hills,
called the Three Brothers, about nine miles to the westward of Cape
St. Diego, the low point that forms the north entrance of the Streight
of Le Maire.
It is said in the account of Lord Anson’s voyage, that it is difficult
to determine exactly where the Streight lies, though the appearance
of Terra del Fuego be well known, without knowing also the
appearance of Staten Land; and that some navigators have been
deceived by three hills on Staten Land, which have been mistaken
for the Three Brothers on Terra del Fuego, and so over-shot the
Streight. But no ship can possibly miss the Streight that coasts Terra
del Fuego within sight of land, for it will then of itself be sufficiently
conspicuous; and Staten Land, which forms the east side, will be still
more manifestly distinguished, for there is no land on Terra del
Fuego like it. The Streight of Le Maire can be missed only by
standing too far to the eastward, without keeping the land of Terra
del Fuego in sight: if this is done, it may be missed, however
accurately the appearance of the coast of Staten Land may have
been exhibited; and if this is not done, it cannot be missed, though
the appearance of that coast be not known. The entrance of the
Streight should not be attempted but with a fair wind and moderate
weather, and upon the very beginning of the tide of flood, which
happens here at the full and change of the moon, about one or two
o’clock; it is also best to keep as near to the Terra del Fuego shore
as the winds will admit. By attending to these particulars, a ship may
be got quite through the Streight in one tide; or, at least, to the
southward of Success Bay, into which it will be more prudent to put,
if the wind should be southerly, than to attempt the weathering of
Staten Land with a lee wind and a current, which may endanger her
being driven on that island.
The Streight itself, which is bounded on the west by Terra del
Fuego, and on the east by the west end of Staten Land, is about five
leagues long, and as many broad. The Bay of Good Success lies
about the middle of it, on the Terra del Fuego side, and is discovered
immediately upon entering the Streight from the northward: and the
south head of it may be distinguished by a mark on the land, that
has the appearance of a broad road, leading up from the sea into
the country: at the entrance it is half a league wide, and runs in
westward about two miles and a half. There is good anchorage in
every part of it, in from ten to seven fathom, clear ground; and it
affords plenty of exceeding good wood and water. The tides flow in
the Bay, at the full and change of the moon, about four or five
o’clock, and rise about five or six feet perpendicular. But the flood
runs two or three hours longer in the Streight than in the Bay; and
the ebb, or northerly current, runs with near double the strength of
the flood.
In the appearance of Staten Land, we did not discover the
wildness and horror that is ascribed to it in the account of Lord
Anson’s voyage. On the north side are the appearances of bays or
harbours; and the land, when we saw it, was neither destitute of
wood nor verdure, nor covered with snow. The island seems to be
about twelve leagues in length, and five broad.
On the west side of the Cape of Good Success, which forms the S.
W. entrance of the Streight, lies Valentine’s Bay, of which we only
saw the entrance; from this bay the land trends away to the W. S.
W. for twenty or thirty leagues; it appears to be high and
mountainous, and forms several bays and inlets.
At the distance of fourteen leagues from the Bay of Good Success,
in the direction of S. W. ½ W. and between two and three leagues
from the shore, lies New Island. It is about two leagues in length
from N. E. to S. W. and terminates to the N. E. in a remarkable
hillock. At the distance of seven leagues from New Island, in the
direction of S. W. lies the Isle Evouts; and a little to the W. of the
south of this island lie Barnevelt’s two small flat islands, close to
each other; they are partly surrounded with rocks, which rise to
different heights above the water, and lie twenty-four leagues from
the Streight of Le Maire. At the distance of three leagues from
Barnevelt’s islands, in the direction of S. W. by S. lies the S. E. point
of Hermit’s islands: these islands lie S. E. and N. W., and are pretty
high: from most points of view they will be taken for one island, or a
part of the main.
From the S. E. point of Hermit’s islands to Cape Horn the course is
S. W. by S., distance three leagues.
The appearance of this Cape and Hermit’s islands is represented in
the chart of this coast, from our first making land to the Cape, which
includes the Streight of Le Maire, and part of Staten Land. In this
chart I have laid down no land, nor traced out any shore but what I
saw myself, and thus far it may be depended upon: the bays and
inlets, of which we saw only the openings, are not traced; it can,
however, scarcely be doubted, but that most, if not all of them,
afford anchorage, wood, and water. The Dutch squadron,
commanded by Hermit, certainly put into some of them in the year
1624. And it was Chapenham, the Vice-Admiral of this squadron,
who first discovered that the land of Cape Horn consisted of a
number of islands. The account, however, which those who sailed in
Hermit’s fleet have given of these parts is extremely defective; and
those of Schouton and Le Maire are still worse. It is therefore no
wonder that the charts hitherto published should be erroneous, not
only in laying down the land, but in the latitude and longitude of the
places they contain. I will, however, venture to assert, that the
longitude of few parts of the world is better ascertained than that of
the Streight of Le Maire, and Cape Horn, in the chart now offered to
the public, as it was laid down by several observations of the sun
and moon, that were made both by myself and Mr. Green.
The variation of the compass on this coast I found to be from 23°
to 25° E. except near Barnevelt’s islands and Cape Horn, where we
found it less, and unsettled: probably it is disturbed here by the
land, as Hermit’s squadron, in this very place, found all their
compasses differ from each other. The declination of the dipping-
needle, when set upon shore in Success Bay, was 68° 15ʹ below the
horizon.
Between Streight Le Maire and Cape Horn we found a current
setting, generally very strong, to the N. E. when we were in with the
shore; but lost it when we were at the distance of fifteen or twenty
leagues.
On the 26th January, we took our departure from Cape Horn,
which lies in latitude 55° 53ʹ S. longitude, 68° 13ʹ W. The farthest
southern latitude that we made was 60° 10ʹ, our longitude was then
74° 30ʹ W.; and we found the variation of the compass, by the mean
of eighteen azimuths, to be 27° 9ʹ E. As the weather was frequently
calm, Mr. Banks went out in a small boat to shoot birds, among
which were some albatrosses and sheerwaters. The albatrosses were
observed to be larger than those which had been taken northward of
the Streight; one of them measured ten feet two inches from the tip
of one wing to that of the other, when they were extended: the
sheerwater, on the contrary, is less, and darker coloured on the
back. The albatrosses we skinned, and having soaked them in salt-
water till the morning, we parboiled them, then throwing away the
liquor, stewed them in a very little fresh water till they were tender,
and had them served up with savoury sauce; thus dressed, the dish
was universally commended, and we eat of it very heartily even
when there was fresh pork upon the table.
From a variety of observations which were made with great care,
it appeared probable in the highest degree, that, from the time of
our leaving the land to the 13th of February, when we were in
latitude 49° 32ʹ, and longitude 90° 37ʹ, we had no current to the
west.
At this time we had advanced about 12° to the westward, and 3
and ½ to the northward of the Streight of Magellan; having been
just three and thirty days in coming round the land of Terra del
Fuego, or Cape Horn, from the east entrance of the Streight to this
situation. And though the doubling of Cape Horn is so much
dreaded, that, in the general opinion, it is more eligible to pass
through the Streight of Magellan, we were not once brought under
our close-reef’d topsails after we left the Streight of Le Maire. The
Dolphin, in her last voyage, which she performed at the same
season of the year with ours, was three months in getting through
the Streight of Magellan, exclusive of the time that she lay in Port
Famine; and I am persuaded, from the winds we had, that if we had
come by that passage, we should not at this time have been in these
seas; that our people would have been fatigued, and our anchors,
cables, sails and rigging much damaged; neither of which
inconveniencies we had now suffered. But supposing it more eligible
to go round the Cape, than through the Streight of Magellan; it may
still be questioned, whether it is better to go through the Streight of
Le Maire, or stand to the eastward, and go round Staten Land. The
advice given in the Account of Lord Anson’s voyage is, “That all ships
bound to the South Seas, instead of passing through the Streight of
Le Maire, should constantly pass to the eastward of Staten Land,
and should be invariably bent on running to the southward as far as
the latitude of 61 or 62 degrees, before they endeavour to stand to
the westward.” But, in my opinion, different circumstances may at
one time render it eligible to pass through the Streight, and to keep
to the eastward of Staten Land at another. If the land is fallen in
with to the westward of the Streight, and the wind is favourable for
going through, I think it would be very injudicious to lose time by
going round Staten Land, as I am confident that, by attending to the
directions which I have given, the Streight may be passed with the
utmost safety and convenience. But if, on the contrary, the land is
fallen in with to the eastward of the Streight, and the wind should
prove tempestuous or unfavourable, I think it would be best to go
round Staten Land. But I cannot in any case concur in
recommending the running into the latitude of 61 or 62, before any
endeavour is made to stand to the westward. We found neither the
current nor the storms which the running so far to the southward is
supposed necessary to avoid; and, indeed, as the winds almost
constantly blow from that quarter, it is scarcely possible to pursue
the advice. The navigator has no choice but to stand to the
southward, close upon a wind, and by keeping upon that tack, he
will not only make southing, but westing; and, if the wind varies
towards the north of the west, his westing will be considerable. It
will, indeed, be highly proper to make sure of a westing sufficient to
double all the lands, before an attempt is made to stand to the
northward, and to this every man’s own prudence will of necessity
direct him.
We now began to have strong gales and heavy seas, with irregular
intervals of calm and fine weather.
CHAP. VII.
testbankdeal.com