Get (Ebook PDF) Starting Out With Java: From Control Structures Through Data Structures 4th Edition PDF Ebook With Full Chapters Now
Get (Ebook PDF) Starting Out With Java: From Control Structures Through Data Structures 4th Edition PDF Ebook With Full Chapters Now
com
https://ebookluna.com/product/ebook-pdf-starting-out-with-
java-from-control-structures-through-data-structures-4th-
edition/
OR CLICK HERE
DOWLOAD NOW
https://ebookluna.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-data-structures-3rd-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-objects-7th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-starting-out-with-c-from-
control-structures-through-objects-8th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-starting-out-with-c-from-
control-structures-through-objects-brief-version-8th-edition/
ebookluna.com
(eBook PDF) Starting Out with C++ from Control Structures
to Objects 9th Edition
https://ebookluna.com/product/ebook-pdf-starting-out-with-c-from-
control-structures-to-objects-9th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-global-edition/
ebookluna.com
https://ebookluna.com/product/data-structures-and-abstractions-with-
java-5th-edition-ebook-pdf/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-data-structures-and-other-
objects-using-java-4th-edition/
ebookluna.com
STARTING OUT WITH JAVA™
From Control Structures through Data Structures
FOURTH EDITION
Tony Gaddis
Godfrey Muganda
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
Title: Starting out with Java. From control structures through data structures /
Tony Gaddis, Haywood Community College, Godfrey Muganda, North
Central College.
1 18
ISBN-13: 978-0-13-478796-1
ISBN-10: 0-13-478796-X
Contents in Brief
1. Chapter 1 Introduction to Computers and Java 1
21. Chapter 21 Binary Trees, AVL Trees, and Priority Queues 1287
1. Index 1353
1. 1.1 Introduction 1
1. Hardware 2
2. Software 5
1. What Is a Program? 6
2. A History of Java 8
1. Language Elements 8
3. Variables 11
2. Programming Challenge 25
2. 2.2 The print and println Methods, and the Java API 33
4. Identifiers 42
5. Class Names 44
1. Integer Division 57
2. Operator Precedence 57
1. Reading a Character 89
2. Mixing Calls to nextLine with Calls to Other Scanner
Methods 89
3. An Example Program 94
6. Flags 118
2. Precision 164
4. Flags 167
Death of Cato
FOOTNOTES
[119] [Florusd says: “Scipio got off in a ship but, as the enemy
overtook him, he thrust his sword into his bowels; and when
some one asked where he was, he returned this answer: ‘The
general is well.’” Appianf says: “he ran his sword through his
body, and threw himself into the sea.”]
[120] [Says Florusd: “Petreius slew both Juba and himself; and
the half-consumed meats and funeral dishes were mixed with the
blood of a king and a Roman.”]
[121] [Florusd in Roman fashion says: “Hearing of the defeat of
his party, he did not hesitate to die; but even cheerfully, as
became a wise man, hastened his own death.”]
[122] [Sallust’s comparison of Cæsar and Cato should not
mislead the reader as to the importance of the latter, who in fact
exercised little influence on the great events of his age.]
CHAPTER XXV. THE CLOSING SCENES OF
CÆSAR’S LIFE
THE END OF THE AFRICAN WAR
Cæsar settled the affairs of Africa with his usual despatch, and
sailed from Utica on the fourteenth day of April, 46 b.c. On his way
to Italy, he stopped at Caralis, in Sardinia. The aid which the island
had afforded to his adversaries furnished him with a decent pretext
for extorting from the inhabitants large sums of money. At the end
of the same month he again weighed anchor; but the prevalence of
easterly winds drove him repeatedly to shore, and he at last reached
Rome on the twenty-eighth day after his departure from the
Sardinian capital. The reports he received at this time of the revival
of the republican cause in Spain did not give him much uneasiness.
Cneius had been detained by sickness in the Baleares, and the
fugitives from the field of Thapsus had been almost all cut off in
their attempts to reach the point to which their last hopes were
directed. The legionaries who had mutinied against Cassius Longinus
were still either unsatisfied with their treatment under the
commander who had superseded him, or fearful of their general’s
vengeance when a fitting opportunity should arrive. It was from
Cæsar’s own soldiers that the invitation had gone forth to the
republican chiefs to renew the struggle on the soil of Spain. The
spirit of the old commonwealth still survived in many of the towns of
Bætica; promises of support were freely given; but the remnant of
the African armament was contemptible both in numbers and ability.
Of all the haughty nobles who had thronged the tent of Pompey at
Luceria or Thessalonica, not one with a name known to history
remained in arms, except Labienus alone. He indeed had succeeded
in making his escape from Africa, in company with Varus; but the
insurgents had already placed themselves under the command of
Scapula and Aponius, officers of their own, nor would they suffer
themselves to be transferred from them to any other except the son
of the great Pompey. The extent to which the flame of insurrection
had spread was probably unknown at this time to Cæsar. He was
impatient to reap at last the fruit of so much bloodshed, to assume
the post of honour he had won, and to work out the principles and
objects of so many years of anticipation. A distant and contemptible
outbreak might be subdued without meeting it in person.
Accordingly, C. Didius, an officer of no eminent reputation, was sent
with a naval and military force to the succour of Trebonius, whom,
however, he found already expelled from his government by the
growing force of the new movement.
Meanwhile Rome had sunk, during the conqueror’s absence, into a
state of torpid tranquillity. The universal conviction that the dictator’s
power was irresistible had quelled all further heavings of the spirit of
discontent. Dolabella had been gratified with a command in the late
campaign; while others, in whose fidelity and military skill he could
rely, had been left behind to overawe disaffection. The most
illustrious of the nobility having now no occasion to remain at Rome
for the sake of paying court to a jealous ruler, had retired generally
to their country seats; but Cicero seems to have feared giving
occasion for distrust if he withdrew himself from the broad eye of
public observation. He occupied himself, however, in his philosophical
studies, and could rejoice that he had never, like so many of his
contemporaries when plunging into the excitements of political life,
abandoned the literary pursuits common to them in youth. While he
still regarded the contest in Africa with the sentiments of a true
republican, he confessed with a sigh that though the one cause was
assuredly the more just, yet the victory of either would be equally
disastrous. He probably held aloof from the proceedings of the
servile senate, which occupied itself during the months of Cæsar’s
absence in devising new honours for his acceptance. First of all it
decreed the religious ceremony of a thanksgiving of forty days,
being twice the term to which the compliance of popular gratitude
had ever previously extended, and it was by the length of the
observance that the honour was estimated. Next it appointed that
the victor’s triumphal car should be drawn by horses of white, the
sacred colour, and that the number of his attendant lictors should be
doubled. He was to be requested to undertake the office of censor
for three years, under a new title, which should not remind the
citizens too closely of the times of republican liberty, that of
præfectus morum, or regulator of manners. The changes which the
revolutionary storm had effected in the condition of so many of the
citizens justified a resort to the old constitutional resource for
purging the senate of scandalous or impoverished members, and
infusing new blood into its veins.
The most substantial of all these tributes to Cæsar’s ascendency
was the decree by which he was appointed dictator for a period of
ten years; for thus the initiative of legal measures was united in his
hands with the command of the legions both at home and abroad.
Other specious honours, in the taste of the times, were accumulated
upon him. His chair was to be placed between those of the consuls
in the assembly of the senate; he was to preside and give the signal
in the games of the circus; and his figure in ivory was to be borne in
procession among the images of the gods, and laid up in the Capitol,
opposite the seat of Jupiter himself. A statue was to be erected to
him in bronze, standing upon a globe, with the inscription, “Cæsar
the demi-god.” His name was to be engraved on the entablature of
the Capitol, in the place of that of Catulus, its true restorer. The
historian who recounts these honours assures us that many others
besides these were offered; he has only omitted to specify them
because Cæsar did not think fit to accept them. It is difficult to
imagine to what lower depth of obsequiousness the senate could
have descended, or what higher dignities the conqueror would have
rejected.
CÆSAR’S TRIUMPHS
The time had now arrived for the celebration of the Gallic triumph,
which had been so long postponed. In the interval, the imperator’s
victories had been multiplied, and the ranks of his veterans had been
recruited by fresh enlistments; so that every soldier who had shared
in his later perils and successes demanded the reward of
participating in his honours. Cæsar claimed not one, but four
triumphs: the first, for his conquest of the Gauls; the second for his
defeat of Ptolemy; another, for his victory over Pharnaces; and the
last, for the overthrow of Juba. But he carefully avoided all reference
to what were in reality the most brilliant of his achievements. In
Spain and Thessaly he had routed the disciplined legions of his own
countrymen; but their defeat brought no accession of honour or
territory to the republic. The glory it reflected on the victor was
dubious and barren. The four triumphs were celebrated, with
intervals of a few days between each, that the interests of the public
might not pall with satiety. The first procession formed in the
Campus Martius, outside the walls of the city. It defiled through the
triumphal gate at the foot of the Capitoline Hill, and crossed the
deep hollow of the Velabrum and Forum Boarium, on its way to the
Circus Maximus, which occupied the valley between the Palatine and
Aventine. In passing through the Velabrum, the chariot in which the
imperator stood, happened to break down; a mischance which so
affected him that he never afterwards, it is said, ascended a vehicle
without repeating a charm.
The long procession wound round the base of the Palatine,
skirting the Aventine and Cælian hills, to the point where the arch of
Constantine now stands. There it began the ascent of the gentle
slope which separates the basin of the Colosseum from that of the
Roman Forum. It followed the same track which now leads under
the arch of Titus, paved at this day with solid masses of hewn stone,
which may possibly have re-echoed to the tramp of Cæsar’s legions.
Inclining a little to the right at the point where it gained the summit
of the ridge and looked down upon the comitium and rostra, in the
direction of the Capitol, it passed before the spot where the temple
of Julius was afterwards built; thence it skirted the right side of the
Forum, under the arch of Fabius, till it reached a point just beyond
the existing arch of Severus, where the two roads branched off, the
one to the Capitoline temple, the other to the Mamertine prison.
Here it was that Cæsar took the route of triumph to the left, while
Vercingetorix was led away to the right, and strangled in the
subterranean dungeon. The Gallic hero doubtless met with firmness
and dignity the fate to which he had so long been doomed, while his
conqueror was exhibiting a melancholy spectacle of human infirmity,
crawling up the steps of the Capitol on his knees, to avert, by an act
of childish humiliation, the wrath of the avenging Nemesis. The next
instance of similar degradation recorded is that of the emperor
Claudius, who being corpulent and clumsy performed the ungraceful
feat with the support of an arm on either side. The practice was
probably of no unusual occurrence, and was deeply rooted, we may
believe, in ancient and popular prejudices. A remnant of it still exists,
and may be witnessed by the curious, even at the present day, on
the steps of the Ara Cœli and at the Santa Scala of the Lateran.
The days of triumph which succeeded passed over with
uninterrupted good fortune. The populace were gratified with the
sight of the Egyptian princess Arsinoe led as a captive at the
conqueror’s wheels; but she was spared the fate of the Gallic
chieftain out of favour to her sister, or perhaps out of pity to her sex.
The son of the king of Numidia who followed the triumphal car was
also spared, and lived to receive back his father’s crown from
Augustus. Though Cæsar abstained from claiming the title of a
triumph over his countrymen, he did not scruple to parade their
effigies among the shows of the procession. The figures or pictures
of the vanquished chiefs were carried on litters, and represented the
manner of their deaths. Scipio was seen leaping desperately into the
sea; Cato plunging the sword into his own bowels; Juba and Petreius
engaged in mortal duel; Lentulus stabbed by the Egyptian assassin;
Domitius pierced perhaps in the back, in token of his flight. The
figure of Pompey alone was withheld for fear of the commiseration it
might excite among the people whose favourite he had so lately
been. Nor, as it was, were the spectators unmoved. Upon the
unfeeling display of Roman defeat and
disaster they reflected with becoming
sensibility. But the pictures of Achillas and
Pothinus were received with unmingled
acclamations, and loud was the cry of scorn
at the exhibition of Pharnaces flying in
confusion from the field. After all, the most
impressive part of the ceremony must have
been the appearance of the rude veterans
whose long files closed the procession. With
what ignorant wonder must the children of
Gaul and Iberia, of Epirus and Africa, have
gazed at the splendour of the city, of which
the fame resounded in their native cabins!
What contempt must they have felt for the
unarmed multitudes grinning around them!
How reckless must they have been of the
A Sacrificator dignity of the consuls and senators, they
who claimed the license of shouting derisive
songs in the ears of their own commander!
Little did they think that grave historians would sum up their coarse
camp jokes in evidence against the fame of their illustrious leader;
still less did they dream of the new power which the military class
was thenceforth to constitute in the state. Rome in fact was their
own; but it was a secret they were not yet to discover.
The satisfaction of his armed supporters, however, was the first
condition on which the supreme power of the dictator must
henceforth be maintained in the city. It was a matter, indeed, of
hardly less importance to secure the good humour of the urban
population. While the soldiers receive each a donative of twenty
thousand sesterces, the claims of the much larger multitude of the
free citizens were not undervalued severally at four hundred;
especially as they received the additional gratification of one year’s
remission of house rent. It does not appear how this indulgence
differed from that for which Cælius and Dolabella had raised their
commotions; but the dictator had so strenuously resisted every
attempt to set aside the just claims of creditors on all previous
occasions, that it can hardly be doubted that in this case he gave the
landlords compensation from the public treasury. The mass of the
citizens was feasted at a magnificent banquet, at which the Chian
and Falernian wines, the choicest produce of Greece and Italy,
flowed freely from the hogshead, and towards which six thousand
lampreys, the most exquisite delicacy of the Roman epicure, were
furnished by a single breeder. The mighty multitude reclined before
twenty-two thousand tables; each table having its three couches,
and each couch, we may suppose, its three guests; so that the
whole number feasted may have amounted to nearly two hundred
thousand. When Cæsar undertook the functions of his censorship,
the number of recipients of the public distributions of corn was
estimated at 320,000. Upon a scrutiny into their claims as genuine
and resident citizens, he was enabled to strike off as many as
150,000 from this list. Adding to the remainder the senators and
knights, and the few wealthy individuals who might have scorned to
partake of a state provision, the sum will correspond pretty
accurately with the number of the imperial guests as above
computed.
The public shows with which these gratifications were
accompanied were carried out on a scale of greater magnificence
than even those recently exhibited by Pompey. There was nothing in
which the magistrates of the republic vied more ostentatiously with
one another than in the number of wild beasts and gladiators which
they brought into the arena. The natural taste of the Italian people
for shows and mummery degenerated more and more into an
appetite for blood; but in this, as in every other respect, it was
Cæsar’s ambition to outdo his predecessors, and the extraordinary
ferocity and carnage of the exhibitions which he complacently
witnessed excited a shudder even in the brutal multitude. The
combatants in the games of the Circus were either professional
gladiators, who sold their services for a certain term of years, or
captives taken in war, or lastly public criminals. But Cæsar was,
perhaps, the first to encourage private citizens to make an exhibition
of their skill and valour in these mortal combats. He allowed several
men of equestrian rank, and one the son of a prætor, to demean
themselves in the eyes of their countrymen by this exposure to the
public gaze. It was only when a senator named Fulvius Setinus
asked permission thus to prostitute his dignity, that the dictator was
at last roused to restrain the growing degradation.
If the people of Rome were shocked at the bloodshed which they
were invited to applaud, it seems that they were offended also at
the vast sums which were lavished on these ostentatious spectacles.
They would have preferred, perhaps, that the donative to
themselves should have been greater, and the soldiers even
exhibited symptoms of discontent and mutiny in consequence. No
instance of Cæsar’s profuse expenditure excited greater admiration
than his stretching a silken awning over the heads of the spectators
in the Circus. This beautiful material was brought only from the
farthest extremity of India, and was extremely rare and precious at
Rome at that time. Three centuries later it was still so costly that a
Roman emperor forbade his wife the luxury of a dress of the finest
silk unmixed with a baser fabric. But a more permanent and worthy
object of imperial expenditure was the gorgeous Forum of which
Cæsar had long since laid the foundation with the spoils of his Gallic
Wars. Between the old Roman Forum and the foot of the Quirinal, he
caused a large space to be enclosed with rows of marble corridors,
connecting in one suite halls of justice, chambers of commerce, and
arcades for public recreation. In the centre was erected a temple to
Venus the ancestress, the patroness for whom Cæsar had woven a
breastplate of British pearls, and whose name he had used as his
watchword on the days of his greatest victories. He now completed
the series of his triumphal shows by the dedication of this favourite
work. It remained for centuries a conspicuous monument of the
fame and magnificence of the first of the Cæsars. His successors
were proud to cluster new arches and columns by its side, and
bestowed their names upon the edifices they erected in connection
with it. Finally, Trajan cut through the elevated ridge which united
the Capitoline with the Quirinal, and impeded the further extension
of the imperial forums. He filled the hollow with a new range of
buildings, occupying as much ground as the united works of his
predecessors in this quarter. The depth of his excavation is indicated,
it is said, by the height of the pillar which bears his name.