Instant Access to Think Java How to Think Like a Computer Scientist 2nd Edition Allen B. Downey ebook Full Chapters
Instant Access to Think Java How to Think Like a Computer Scientist 2nd Edition Allen B. Downey ebook Full Chapters
com
https://ebookmeta.com/product/think-java-how-to-think-like-
a-computer-scientist-2nd-edition-allen-b-downey/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/think-python-how-to-think-like-a-
computer-scientist-allen-b-downey/
ebookmeta.com
https://ebookmeta.com/product/think-python-how-to-think-like-a-
computer-scientist-2nd-edition-allen-b-downey/
ebookmeta.com
https://ebookmeta.com/product/think-python-how-to-think-like-a-
computer-scientist-2nd-edition-allen-b-downey-3/
ebookmeta.com
https://ebookmeta.com/product/the-work-of-whiteness-a-psychoanalytic-
perspective-1st-edition-helen-morgan/
ebookmeta.com
https://ebookmeta.com/product/the-ascetic-programmer-how-asceticism-
benefits-programming-science-and-the-arts-antonio-piccolboni/
ebookmeta.com
https://ebookmeta.com/product/history-of-war-book-of-the-napoleonic-
wars-6th-edition-history-of-war/
ebookmeta.com
https://ebookmeta.com/product/ships-of-the-royal-navy-5th-edition-ben-
warlow/
ebookmeta.com
The End of Certainty Scott Morrison and Pandemic Politics
1st Edition Katharine Murphy
https://ebookmeta.com/product/the-end-of-certainty-scott-morrison-and-
pandemic-politics-1st-edition-katharine-murphy/
ebookmeta.com
Think Java
SECOND EDITION
How to Think Like a Computer Scientist
If you don’t want to use Git at all, you can download the code in
a ZIP archive using the Download ZIP button on the GitHub
page, or this link: https://thinkjava.org/code2zip.
After you clone the repository or unzip the ZIP file, you should have
a directory named ThinkJavaCode2 with a subdirectory for each
chapter in the book.
The examples in this book were developed and tested using
OpenJDK 11. If you are using a more recent version, everything
should still work. If you are using an older version, some of the
examples might not.
If example code is offered with this book, you may use it in your
programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the
code. For example, writing a program that uses several chunks of
code from this book does not require permission. Selling or
distributing examples from O’Reilly books does require permission.
Answering a question by citing this book and quoting example code
does not require permission. Incorporating a significant amount of
example code from this book into your product’s documentation
does require permission.
We appreciate, but generally do not require, attribution. An
attribution usually includes the title, author, publisher, and ISBN. For
example: “Think Java by Allen B. Downey and Chris Mayfield.
(O’Reilly). Copyright 2020 Allen B. Downey and Chris Mayfield, 978-
1-492-07250-8.”
If you feel your use of code examples falls outside fair use or the
permission given above, feel free to contact us at
[email protected].
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file
extensions.
Bold
Indicates vocabulary words defined at the end of each chapter.
Constant width
Used for program listings, as well as within paragraphs to refer
to program elements such as variable or function names,
databases, data types, environment variables, statements, and
keywords.
Constant width bold
Shows commands or other text that should be typed literally by
the user.
O’Reilly Online Learning
For more than 40 years, O’Reilly Media has provided technology and
business training, knowledge, and insight to help companies succeed.
Sebastopol, CA 95472
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples,
and any additional information. You can access this page at
https://oreil.ly/think-java-2e.
Email [email protected] to comment or ask technical
questions about this book.
For more information about our books, courses, conferences, and
news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
Another Random Document on
Scribd Without Any Related Topics
mass of obscenity which is not to be excused either by the manners
of the time nor by the exigencies of the story.
DON QUIXOTE
MIGUEL DE CERVANTES
Don Quixote goes forth upon his battered Rocinante, to redress all
wrongs, actual or imaginary, to fight windmills, to engage in
desperate battles with flocks of sheep; to sail upon enchanted barks;
to fly through the air on a wooden horse; and perform a thousand
extravagances, travesties of the impossible prodigies recorded in
books of chivalry and enchantment.
“Prithee, tell me, hast thou not seen some comedy played wherein
are introduced kings, emperors, pontiffs, knights, ladies and
divers other personages? One plays the bully, another the knave;
one the merchant, one the soldier; others the witty fool and the
foolish lover; and, the comedy ended and their apparel put off, all
the players remain equal.”
“I only know that while I sleep I have no fear, nor hope, nor
trouble, nor glory; and good luck to him who invented sleep, a
cloak which covers all a man’s thoughts, the meat which takes
away hunger, the water which quenches thirst, the fire which
warms the cold, the cold which tempers the heat; to end up, the
general coin with which all things are bought, the balance and
weight which levels the shepherd with the king and the fool with
the wise man. There is only one thing, as I have heard say, is bad
about sleep, and it is that it looks like death, for between the
sleeping and the dead there is very little difference.”
“Don Quixote” has been the model upon which many of the best
works of fiction have been based. One can see distinct traces of
Cervantes’s methods in “Pickwick Papers.” There are undoubtedly
many points of difference between Mr. Pickwick and Don Quixote,
yet the points of resemblance are very clear; and Sam Weller
corresponds more nearly to Sancho than any character in modern
fiction. The lugubrious episodes in the “Pickwick Papers” are not
wholly unlike those in “Don Quixote,” and the solemnity of these
episodes furnishes the same contrast to the merry absurdities of the
narrative itself.
His first place is with the fat licentiate, Sedillo, where he serves
faithfully and leads a dog’s life in hopes of a legacy, as soon as his
master shall be carried off with the gout. He gets as the legacy his
master’s library, consisting of three books, “The Perfect Cook,” a
work on indigestion, and a breviary. Then he takes a situation with
Dr. Sangrado, the physician who has hastened Sedillo’s departure
from the world, from whom he learns in a word the whole art of
healing, to wit, bleeding profusely and administering vast quantities
of hot water, a system which Gil Blas puts into practice as
Sangrado’s deputy, kills most of his patients, and has to flee from
Valladolid in the night. After many adventures he arrives at Madrid,
becomes the servant of Don Mathias de Silva, a dissolute young
nobleman, and learns much of the ways of the world. Dressed in his
master’s clothes, he makes love to a great lady, as he supposes, but
finds that she is Laura, the maid of the actress Arsenia, whom his
master visits. Don Mathias is killed in a duel, whereupon our hero
takes service with the actress, and has fine times with his dear
Laura, but at last leaves the place because he is unwilling “to live
any longer with the seven mortal sins.” Next he takes a situation with
Don Vincent de Guzman, fancies that his master’s daughter Aurora
is in love with him, and makes a great fool of himself at a midnight
interview, where she seeks his aid in behalf of her passion for Don
Luis Pacheco. A very pretty story follows of her efforts in the guise of
a man to inspire Pacheco’s love, efforts which are not unlike those of
Rosalind with Orlando, and which in like manner are crowned with
success. Gil Blas then goes to live with Pacheco’s uncle, an
asthmatic old man, who looks “like the resurrection of Lazarus,” but
who loves the young and beautiful Euphrasia. Gil Blas finds another
gallant hidden in her room, and tells his master, but he is dismissed
for his pains.
After the bishop has had an attack of apoplexy, and the time comes
for Gil Blas to perform his duty, this is what happens:
The only thing that embarrassed me now was how to break the
ice. Luckily the orator himself extricated me from that difficulty, by
asking what people said of him, and if they were satisfied with his
last discourse. I answered that his homilies were always admired,
but in my opinion the last had not succeeded so well as the rest,
in affecting the audience. “How, friend!” replied he, with
astonishment, “has it met with any Aristarchus?” “No, sir,” said I,
“by no means; such works as yours are not to be criticised;
everybody is charmed with them. Nevertheless, since you have
laid your injunctions upon me to be free and sincere, I will take the
liberty to tell you that your last discourse, in my judgment, has not
altogether the energy of your other performances. Are you not of
the same opinion?”
And so the comedy goes on. One new face after another appears on
the scene, among them Captain Hannibal Chinchilla, with monstrous
moustache, who has left an eye in Naples, an arm in Lombardy, and
a leg in the Low Country; then Count Galiano, who is fonder of his
monkey than of his servants. Our hero becomes one of the
secretaries of the prime minister, the Duke of Lerma, where he
acquires great honor, but for a long time, no pay. Finally he sells his
influence, gets into court intrigues, rises step by step, until he is
about to marry the daughter of a rich jeweller, when he is arrested
and thrown into the tower of Segovia. Here he is found by his faithful
valet Scipio, who gets him released. He now determines to renounce
the court forever, and his old friend Don Alphonso gives him a small
estate at Lirias. But when the new king comes in, Gil Blas is tempted
back again, rises rapidly under Count Olivares, and when this
minister falls, follows him into retirement. Upon the death of the
count, Gil Blas returns to Lirias, where his marriage and his happy
life with his wife, Dorothea, close the story.
All through the book stories of the events of their own lives are told
by the principal characters. The robbers in the cave, Doña Mencia,
Don Alphonso, Don Raphael, Scipio, and others, all give us their
histories, which resemble in miniature the principal narrative. The
novel is a very long one, and although it is well written everywhere,
the latter part contains some incidents which seem like repetitions,
and the interest is not held quite up to the standard of the earlier
books.
“Gil Blas” is an admirable prose satire, a satire written with the light
raillery of Horace rather than the invective of Juvenal. It sparkles
everywhere with French wit, and though the scene is laid in Spain
(the model for that kind of story being the early Spanish tales like
“Lazarillo de Tormes”), yet the style and the characters are
essentially French, and many of the latter are taken from the
acquaintance of the author himself. The illusion, however, is well
maintained, and it is only upon rare occasions (such as the raillery of
the petits maîtres) that one notices characteristics which do not
seem quite at home in Spain. Near the close of the book there are a
number of historical characters (Spanish, of course), but these are
by no means the liveliest or best. Indeed, it may well be doubted
whether “Gil Blas” has not rather suffered than gained by the
introduction of its historical features.
I have noticed that while I can enjoy “Don Quixote” perhaps better in
the translation than the original, “Gil Blas,” on the other hand, sounds
more natural to me in a Spanish version than in the original French.
This may be mere fancy, or perhaps it may be attributed to this, that
“Gil Blas,” being a foreign production, seems more natural after
having been acclimated, as it were, by translation into the language
of the country in which its scenes are laid. “Don Quixote,” on the
other hand, being thoroughly Spanish does not lose its national
characteristics, no matter what the language in which it is
communicated to the reader.
ROBINSON CRUSOE
DANIEL DEFOE
Much of his satire was meant to set off certain follies of his own time,
but to us the most valuable part of it is that which portrays the
general frailties of humanity. He holds up to nature a mirror which,
while it distorts the features a little, still makes the caricature
extremely lifelike. Even where the Lilliputians are most absurd we
recognize their similarity to ourselves. The quarrels between the
partisans of low and high heeled shoes, the revolution and obstinate
war concerning the proper manner of opening an egg, are not a whit
more nonsensical than some of our own social and theological
controversies. The Lilliputians bury their dead with the head down in
order that the body may be in the right position for the resurrection,
just as the Mahometan faces Mecca in his prayers, the Christian
builds his church according to certain points of the compass, and the
ritualist makes his genuflexions in carefully prescribed forms, for
reasons quite as cogent and unanswerable.
The “little people” well knew there were no other regions of the earth
than Lilliput and Blefuscu, and here, too, we are like them. Most of
us consider that all there is of importance in the universe is that
which falls within our own spheres of observation.
No one can read Swift’s story without reflecting that our own little
world must seem much like Lilliput to the great eye which looks upon
this planet as only one among the islands of the firmament.
The proposition to impose a tax upon men’s vices has been put into
practice many a time, and the scheme of a general raffle to secure
the prizes of patronage would seem to be a tolerable refuge from our
former system of political appointments.