- Page 2 and 3: Table of Contents (summary)Introxxi
- Page 4 and 5: 3KnowYour VariablesVariables come i
- Page 7: xivdDuckDuck9Lifeobjectobject‘d
- Page 10 and 11: Socket connectionto port 5000on the
- Page 12 and 13: 18DistributedComputingBeing remote
- Page 14 and 15: how to use this bookWho is this boo
- Page 16 and 17: how to use this bookWe tlUn1 of a"!
- Page 18 and 19: how to use this bookHere"s what WE
- Page 20 and 21: how to use this bookWhat you heed f
- Page 22 and 23: tech editing: Jessica and Valentinf
- Page 24 and 25: " still more acknowledgementsJust w
- Page 26 and 27: the way Java worksfhe Way Java Work
- Page 28 and 29: Avery brief history of Java~ 3500I!
- Page 30 and 31: .'why Java Is coolpen your pencil a
- Page 32 and 33: a Java classAttafottty of aclassWhe
- Page 34 and 35: statements, looping, branchingWhat
- Page 38 and 39: serious Java appCoding aSerious fus
- Page 40 and 41: let's write a programTry my newphra
- Page 42 and 43: the complier and the JVMFireside Ch
- Page 44 and 45: exercise: Code MagnetsCode MagnetsA
- Page 46 and 47: puzzle: crosswordJa~Cr~sst.Olet's g
- Page 48 and 49: puzzle: Pool PuzzleP~l puzzleYourjo
- Page 50 and 51: puzzle answersclass PoolPuzzleOne {
- Page 52 and 53: once upon a time in ObjectvilleChai
- Page 54 and 55: once upon a time in ObjectvilleLarr
- Page 56 and 57: once upon a time in ObjectvilleWhat
- Page 58 and 59: thinking about objectsWhen you desi
- Page 60 and 61: making objectsMaking your first obj
- Page 62 and 63: get the heck out of mainQuick! Get
- Page 64 and 65: Guessing GameRunning the Guessing G
- Page 66 and 67: exercise: Be the Compiler Each of
- Page 68 and 69: puzzle: Pool PuzzlePool Puzzle
- Page 70 and 71: exercise solutionsCode Magnets:clas
- Page 72 and 73: 3 primitives and referencesKnow You
- Page 74 and 75: primitives and referencesPrimitive
- Page 76 and 77: Jack away frotH that keyword!lbu kn
- Page 78 and 79: primitives and referencesThe 3 step
- Page 80 and 81: primitives and referencesott the ga
- Page 82 and 83: primitives and referencesAn array i
- Page 84 and 85: primitives and references,DogJava c
- Page 86 and 87:
prlmltlves and referencesBE the cor
- Page 89 and 90:
~~ftil64 chapter 3puzzle: Heap o' T
- Page 91 and 92:
exercise solutionsCode Magnets:Exer
- Page 93 and 94:
4 methods use Instance variablesHow
- Page 95 and 96:
methods use instance variablesesize
- Page 97 and 98:
methods use instance variablesYou c
- Page 99 and 100:
methods use instance variablesJava
- Page 101 and 102:
methods use instance variables"ttgs
- Page 103 and 104:
methods use Instance variablestheda
- Page 105 and 106:
methods use instance variablesHow d
- Page 107 and 108:
fhe differet1ce betwee" it1sfat1cea
- Page 109 and 110:
methods use Instance variablesMake
- Page 111 and 112:
methods use instance variablesA bun
- Page 113 and 114:
methods use Instance variablespubli
- Page 115 and 116:
methods use Instance variablesBclas
- Page 117 and 118:
5 writing a programExtra-Strength M
- Page 119 and 120:
writing a programFirst a high ...le
- Page 121 and 122:
writing a programPevelopit1Q a Clas
- Page 123 and 124:
writing a programWriting the ttteth
- Page 125 and 126:
•writing a program~relare,..{l? "
- Page 127 and 128:
writing a programe things we haven'
- Page 129 and 130:
writing a programWe built the test
- Page 131 and 132:
-writing a program• Your Java pro
- Page 133 and 134:
writing a programjf...ro things tha
- Page 135 and 136:
writing a programlefs playHere's wh
- Page 137 and 138:
writing a programsthrough a loop ~i
- Page 139 and 140:
writJng a programconverting a Strin
- Page 141 and 142:
writing a programCode MagnetsAworki
- Page 143 and 144:
writing a programA short Java progr
- Page 145 and 146:
writing a programCandidates:x • x
- Page 147 and 148:
we stili have a bug•Itt our lastc
- Page 149 and 150:
fixing the bugHow do we fix it?We n
- Page 151 and 152:
prep codeprep codeOptlo., threeWe d
- Page 153 and 154:
when arrays aren't enoughWake up at
- Page 155 and 156:
when arrays aren't enough~ your pen
- Page 157 and 158:
difference between ArrayList and ar
- Page 159 and 160:
the buggy DotCom codeLetl fix the t
- Page 161 and 162:
making the OotComBustLet's build th
- Page 163 and 164:
detailed structure of the gameWho d
- Page 165 and 166:
the OotComBust class (the game)prep
- Page 167 and 168:
the DotComBust code (the game)impor
- Page 169 and 170:
the DotComBust code (the game)impor
- Page 171 and 172:
the DotCom codeThe final version of
- Page 173 and 174:
Ready-bake: GameHelperimport java.i
- Page 175 and 176:
API packagesUsittg the Library (the
- Page 177 and 178:
when arrays aren't enoughWhere'd th
- Page 179 and 180:
getting to know the API"Good to kno
- Page 181 and 182:
using the Java API documentatione U
- Page 183 and 184:
puzzle: crosswordJavaOr~sst.OHow do
- Page 185 and 186:
puzzJe answersJavaOrctSSanswers~ yo
- Page 187 and 188:
the power of inheritanceChair Wars
- Page 189 and 190:
I way inheritance worksUt1derstat1d
- Page 191 and 192:
Let"s desig" the it1heritattce tree
- Page 193 and 194:
designing for inheritancePo all at1
- Page 195 and 196:
designing for inheritanceFinish the
- Page 197 and 198:
practice designing an inheritance t
- Page 199 and 200:
exploiting the power of objectsJut
- Page 201 and 202:
who inherits whattherelllreAl~Dum D
- Page 203 and 204:
exploiting the power of objectsSo w
- Page 205 and 206:
the way polymorphism worksThe 3 ste
- Page 207 and 208:
polymorphism In actionWith polymorp
- Page 209 and 210:
exploiting the power of polymorphis
- Page 211 and 212:
Keepl.,g the co"tract: rules for ov
- Page 213 and 214:
exercise: Mixed Messagesthe prograt
- Page 215 and 216:
puzzle: Pool PuzzlePool PuzzleYour
- Page 217 and 218:
puzzle answers•pUblic class Rowbo
- Page 219 and 220:
designing with inheritanceDid we fo
- Page 221 and 222:
when objects go badWhat does a new
- Page 223 and 224:
abstract and concrete classesAbstra
- Page 225 and 226:
you must implement abstract methods
- Page 227 and 228:
polymorphism examplesPolymorphism i
- Page 229 and 230:
the ultimate superclass: ObjectWhat
- Page 231 and 232:
Object and abstract classesthere ar
- Page 233 and 234:
When a Dog loses its DognessWhen a
- Page 235 and 236:
objects are ObjectsHe treats me lik
- Page 237 and 238:
casting objectsWait a minute... wha
- Page 239 and 240:
modifying a class treeWhat if you n
- Page 241 and 242:
modifying existing classes2 Option
- Page 243 and 244:
multiple inheritance?So what we REA
- Page 245 and 246:
interfacesInterface to the rescue!
- Page 247 and 248:
interface polymorphismRobotClasses
- Page 249 and 250:
using superInvoking the superclassv
- Page 251 and 252:
exercise: What’s the Picture?Give
- Page 253 and 254:
puzzle: Pool PuzzlePoolPuzzle
- Page 255 and 256:
puzzle solutioninterface Nose {publ
- Page 257 and 258:
the stack and the heapfhe Stack at1
- Page 259 and 260:
object references on the stackWhat
- Page 261 and 262:
object creationfhe tttiracle of obj
- Page 263 and 264:
constructing a new DuckCottStruct a
- Page 265 and 266:
initializing object stateUshtg the
- Page 267 and 268:
overloaded and default constructors
- Page 269 and 270:
overloaded constructors..class Duck
- Page 271 and 272:
space for an object's superclass pa
- Page 273 and 274:
object constructionMaklt1Q a Hippo
- Page 275 and 276:
object lifecycleCatt the child exis
- Page 277 and 278:
calling overloaded constructorslt1v
- Page 279 and 280:
object lifespanNow we know how an o
- Page 281 and 282:
object lifecycleWhat about referett
- Page 283 and 284:
object lifecycleObject-killer #2Ass
- Page 285 and 286:
object lifecycleFireside ChatsTonig
- Page 287 and 288:
exercise: Be the Garbage ColleclorB
- Page 289 and 290:
puzzle: Five Minute Mystery"We've r
- Page 291 and 292:
object Iifecycle1 copyGC = null; No
- Page 293 and 294:
10 numbers and staticsNumbers Matte
- Page 295 and 296:
numbers and staticsfhe differet1ce
- Page 297 and 298:
numbers and staticsStatic tMethods
- Page 299 and 300:
Static variable:value is the satHe
- Page 301 and 302:
numbers and staticshtitializhtg ast
- Page 303 and 304:
numbers and staticsfitlal iSKt just
- Page 305 and 306:
numbers and statics~ yoor pencilWha
- Page 307 and 308:
numbers and staticsWrappit1g a prit
- Page 309 and 310:
Autoboxing: blurring the linebetwee
- Page 311 and 312:
numbers and staticsOperations on nu
- Page 313 and 314:
numbers and staticsAttd .,ow i" rev
- Page 315 and 316:
numbers and staticsFortMaffit1g dec
- Page 317 and 318:
numbers and staticsBut how does it
- Page 319 and 320:
The ot1ly required specifier is for
- Page 321 and 322:
So tMuch for t1utMbers, what about
- Page 323 and 324:
numbers and staticsMovit1Q backward
- Page 325 and 326:
numbers and staticsWorkittg with Ca
- Page 327 and 328:
Evett ttlore Statics!... static jtt
- Page 329 and 330:
numbers and staticsInstance Variabl
- Page 331 and 332:
numbers and staticsThis chapter exp
- Page 333 and 334:
numbers and staticsTrue or Falsesta
- Page 335 and 336:
11 exception handlingRisky Behavior
- Page 337 and 338:
WeIll start with the basicsObviousl
- Page 339 and 340:
exception handlingWhat happet1s whe
- Page 341 and 342:
exception handlingThe cOlMpiler t1e
- Page 343 and 344:
If it's your code that catches the
- Page 345 and 346:
exception handIing• Amethod can t
- Page 347 and 348:
exceptionandlingFh,ally: for the th
- Page 349 and 350:
Pid we lIte.,tio., that atltethod c
- Page 351 and 352:
exception handJust because you CAN
- Page 353 and 354:
exception handlingYou cat1"t put bi
- Page 355 and 356:
exception handlingWhe., you dO.,/t
- Page 357 and 358:
exception handlingHandle or Declare
- Page 359 and 360:
exceptJon handlingCode Kitchen.:(Yo
- Page 361 and 362:
exception handlingAnd you need FIVE
- Page 363 and 364:
exception handlingMakit1g a MidiEve
- Page 365 and 366:
exception handlingChat1ge a tMessag
- Page 367 and 368:
exceptJon handlingWhere we're heade
- Page 369 and 370:
exception handlingCode MagnetsA wor
- Page 371 and 372:
exception handlingCode Magnetsclass
- Page 373 and 374:
12 getting QuiA Very GraphicStoryWo
- Page 375 and 376:
geWng QuiYour first &UI: a button O
- Page 377 and 378:
getting gui&ettit1g a user evetttIm
- Page 379 and 380:
getting guiHow the listener and sou
- Page 381 and 382:
getting guillsfetters, Sources, att
- Page 383 and 384:
getting Qui&ettittg back to graphic
- Page 385 and 386:
getting guiFutt fhit1Qs to do itt p
- Page 387 and 388:
getting gui'ecause life"s too short
- Page 389 and 390:
getting guiWe catt get att evet1t.W
- Page 391 and 392:
getting guiThe circle changes color
- Page 393 and 394:
geWng guiHow do you get actio" eve"
- Page 395 and 396:
getting guiyou are here. 375
- Page 397 and 398:
getting gUiA., f.,.,er class it1sfa
- Page 399 and 400:
getting guiNow we can get the two-b
- Page 401 and 402:
getting guiHeadFirst: Oh, weU you j
- Page 403 and 404:
w\ we !eally want is something like
- Page 405 and 406:
u~. It didn't move••• it smea
- Page 407 and 408:
getting guOK, maybe not a music vid
- Page 409 and 410:
getting guiExatttple: how to use th
- Page 411 and 412:
getting guiVersion Ihree: drawing g
- Page 413 and 414:
exercise: Who Am IWho am IPA bunch
- Page 415 and 416:
getting guiWho am I?I got the whole
- Page 417 and 418:
13 using swingWork on YourSwingSwin
- Page 419 and 420:
Layout MahagersA layout manager is
- Page 421 and 422:
using swingIhe Jig fhree layout ttt
- Page 423 and 424:
using swingWatch what happens when
- Page 425 and 426:
using swingI think rm getting it...
- Page 427 and 428:
using swingLet's add a button to th
- Page 429 and 430:
using swing[ Joo~c=::flf- 0BoxLayou
- Page 431 and 432:
using swingPlayit1Q with Swittg col
- Page 433 and 434:
using swingJTextArea exampleimport
- Page 435 and 436:
using swing~ListConstructorString [
- Page 437 and 438:
using swingMakit1Q the JeatJoxThis
- Page 439 and 440:
using swingdownTempo . addActionLis
- Page 441 and 442:
using swingpublic class (mJ.HRa,~g~
- Page 443 and 444:
using swingcode FragmentsJFrame fra
- Page 445 and 446:
using swing~ExerciSe Solutions~ JFr
- Page 447 and 448:
14 serialization and file I/OSaving
- Page 449 and 450:
Savl"Q StateImagine you have a prog
- Page 451 and 452:
Pata lMoves itt streatMs frotM ot1e
- Page 453 and 454:
serlallzatlon and file I/O-'ut what
- Page 455 and 456:
If you want your class to be serial
- Page 457 and 458:
serialization and file 110It's hope
- Page 459 and 460:
serlallzatJon and file 1/0Peseriali
- Page 461 and 462:
serialization and file I/OG If the
- Page 463 and 464:
serialization and file 110fhe G-atl
- Page 465 and 466:
serialization and file I/OWriti"g a
- Page 467 and 468:
serialization and file 110Quiz Card
- Page 469 and 470:
serialization and file I/OJMenultem
- Page 471 and 472:
serialization and file 1/0The beaut
- Page 473 and 474:
serialization and file 1/0Quiz Card
- Page 475 and 476:
serialization and file 110public cl
- Page 477 and 478:
serialization and file 1/0Q:OK,Iloo
- Page 479 and 480:
serialization an d file 110Usi.,g t
- Page 481 and 482:
serialization and file I/OSavinG a'
- Page 483 and 484:
serialization and file 110~yourpenC
- Page 485 and 486:
-CJu serialization and file 110o e
- Page 487 and 488:
serialization and file 110class Dun
- Page 489 and 490:
tbo)(. chatYou're working on a comp
- Page 491 and 492:
socketconnecllonsThe three things w
- Page 493 and 494:
well-known portsArep port Is Just a
- Page 495 and 496:
eading from a socketTo read data fr
- Page 497 and 498:
writing a clientfhe PailyAdvieeClie
- Page 499 and 500:
socketconnecUonsTest your memory of
- Page 501 and 502:
writing a serverPailyAdviceServer c
- Page 503 and 504:
a simple chat clientWritit1g a Chat
- Page 505 and 506:
improving the chat clientVersion Tw
- Page 507 and 508:
threads and ThreadJava has tMultipl
- Page 509 and 510:
launching a threadHow to launch a n
- Page 511 and 512:
Runnable interlacefo tttake ajob fo
- Page 513 and 514:
thread statesTypical runnableJrunni
- Page 515 and 516:
thread schedulingAn example of how
- Page 517 and 518:
socketconnecUons:t1erelare~Dumo "C.
- Page 519 and 520:
using Thread.sleep()Usittg sleep to
- Page 521 and 522:
aren't threads wonderful?UtM, yes.
- Page 523 and 524:
Ryan and Monica codeThe Ryatt at1d
- Page 525 and 526:
!"Cyan ana MOniCa OUtput:, .FlI& Ed
- Page 527 and 528:
using synchronizedWe t1eed the Itta
- Page 529 and 530:
synchronization mattersfhe dreaded
- Page 531 and 532:
synchronizing methodsMake the ittcr
- Page 533 and 534:
thread deadlockThe deadly side ofsy
- Page 535 and 536:
final chat clientNew and itltproved
- Page 537 and 538:
chat server codeIJ _..Readj-"a"eCad
- Page 539 and 540:
synchronlzaUon questions:t1erel~~Du
- Page 541 and 542:
exercise: Code MagnetsCode MagnetsA
- Page 543 and 544:
exercise solutionspUblic clasa Test
- Page 545 and 546:
puzzle answers•Whatdid Sarah know
- Page 547 and 548:
sorting a listfracki"Q SOt1g popula
- Page 549 and 550:
ArrayList API~ut the ArrayList clas
- Page 551 and 552:
Collectlons.sortOYou could use a fr
- Page 553 and 554:
sorting your own objectsJut now you
- Page 555 and 556:
Collections.s0 rtOIt WOt1~t cotMpi
- Page 557 and 558:
generic types&et1erics ",eat1s ",or
- Page 559 and 560:
generic classesUsing generic CLASSE
- Page 561 and 562:
generic methodsA generic class mean
- Page 563 and 564:
sorting a SongThis still doesn'texp
- Page 565 and 566:
the sortt) method't1 get1erics, "ex
- Page 567 and 568:
the Comparable interfacefhe "eYl, i
- Page 569 and 570:
the Comparator interfaceUshtg a cus
- Page 571 and 572:
collectJons exerciseimportpublic cl
- Page 573 and 574:
dealing with duplicatesUh"'oh. fhe
- Page 575 and 576:
the collections APIThe Collectiot1
- Page 577 and 578:
object equalityWhat tttakes two obj
- Page 579 and 580:
overriding hashCodeO and equalst)Th
- Page 581 and 582:
TreeSets and sortingAt1d ifwe wat1t
- Page 583 and 584:
how TreeSets sortfreeSet elettte.,t
- Page 585 and 586:
generic typesFit1all't back to get1
- Page 587 and 588:
polymorphism and generics~ut will i
- Page 589 and 590:
arrays vs, ArrayUslsWait a minute..
- Page 591 and 592:
generic wildcardsWildcards to the r
- Page 593 and 594:
e the complier.exerciseBE the ~omri
- Page 595 and 596:
f111-in-the-blank solutionPossible
- Page 597 and 598:
17 package, jars and deploymentRele
- Page 599 and 600:
package, jars and deploymentItMagit
- Page 601 and 602:
Put your Java itt aJAR-package, jar
- Page 603 and 604:
Put your classes itt packages!So yo
- Page 605 and 606:
package, jars and deployment_put yo
- Page 607 and 608:
fhe ...dflag is eve" cooler tha" we
- Page 609 and 610:
package, jars and deploymentSo wher
- Page 611 and 612:
package, jars and deploymentQ.: Wha
- Page 613 and 614:
ExecutableJar100% Local--- Web Star
- Page 615 and 616:
The .j"lp filepackage, jars and dep
- Page 617 and 618:
package, jars and deployment,,.LOOk
- Page 619 and 620:
package, jars and deployment~U1Il1I
- Page 621 and 622:
~UtIltIlary-Or~55t. Oyou are here ~
- Page 623 and 624:
how many heaps?..RMlapp100% LocalCo
- Page 625 and 626:
two objects, two heapsObject AI rut
- Page 627 and 628:
client and server helpersfhe role o
- Page 629 and 630:
RMI helper objectsJava RMI gives yo
- Page 631 and 632:
a remote interfaceStep one: Make a
- Page 633 and 634:
Step three: generate stubs and skel
- Page 635 and 636:
getting the stubHow does the client
- Page 637 and 638:
RMI class filesJe sure each lMachht
- Page 639 and 640:
usesfor RMIYeah, but who really use
- Page 641 and 642:
very simple servletStep for making
- Page 643 and 644:
emote deployment with RMIJust for f
- Page 645 and 646:
emote deployment with RMIRMI is gre
- Page 647 and 648:
emote deployment with RMIAdaptive d
- Page 649 and 650:
Self...healit1Q t1etwork it1 actio"
- Page 651 and 652:
emote deployment w ith RMIHow it wo
- Page 653 and 654:
..,remote deployment with RMIThe cl
- Page 655 and 656:
emote deployment with RNass Service
- Page 657 and 658:
emote deployment with RMIObject[] g
- Page 659 and 660:
class MlnlMusicService (a universal
- Page 661 and 662:
emote deployment with RMIclass DayO
- Page 663 and 664:
Appendix A:*Final Code Kitchen*Chri
- Page 665 and 666:
publicnewappendix A Final Code Kitc
- Page 667 and 668:
appendix A Final Code Kitche npubli
- Page 669 and 670:
public class RemoteReader implement
- Page 671 and 672:
appendix A Final Code KitchenFinal
- Page 673 and 674:
Appendix BThe Top Ten Topics that a
- Page 675 and 676:
appendix B Top Ten Reference#9 Immu
- Page 677 and 678:
appendix B Top Ten Reference#7 Bloc
- Page 679 and 680:
appendix B Top Ten Reference#5 Anon
- Page 681 and 682:
access levelsappendix B Top Ten Ref
- Page 683 and 684:
String and StringBufferappendix B T
- Page 685 and 686:
enumerationsappendix B Top Ten Refe
- Page 687 and 688:
enumerationsappendix B Top Ten Refe
- Page 689 and 690:
A Long Trip HomeCaptain Byte knew t