Professional Documents
Culture Documents
Headfirst Java 2 ND Edition
Headfirst Java 2 ND Edition
Dedication.............................................................................................................................. 2
What they're saying about Head First..................................................................................... 3
Praise for Head First Java............................................................................................................................................................................................................... 3
Praise for other Head First books co-authored by Kathy and Bert................................................................................................................................................ 3
Other related books from O'Reilly.................................................................................................................................................................................................. 3
Intro....................................................................................................................................... 7
Who is this book for?....................................................................................................................................................................................................................... 7
We know what you're thinking........................................................................................................................................................................................................ 7
And we know what your brain is thinking...................................................................................................................................................................................... 7
Metacognition: thinking about thinking......................................................................................................................................................................................... 7
Here's what WE did:........................................................................................................................................................................................................................ 7
Here's what YOU can do to bend your brain into submission........................................................................................................................................................ 7
What you need for this book:.......................................................................................................................................................................................................... 7
Last-minute things you need to know:............................................................................................................................................................................................ 7
Technical Editors............................................................................................................................................................................................................................. 7
Other people to credit:..................................................................................................................................................................................................................... 7
Just when you thought there wouldn't be any more acknowledgements....................................................................................................................................... 7
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
Appendix B. The Top Ten Topics that almost made it into the Real Book............................. 676
Section B.1. #10 Bit Manipulation............................................................................................................................................................................................... 677
Section B.2. #9 Immutability...................................................................................................................................................................................................... 678
Section B.3. #8 Assertions........................................................................................................................................................................................................... 679
Section B.4. #7 Block Scope........................................................................................................................................................................................................ 680
Section B.5. #6 Linked Invocations............................................................................................................................................................................................. 681
Section B.6. #5 Anonymous and Static Nested Classes............................................................................................................................................................. 682
Section B.7. #5 Anonymous and Static Nested Classes, continued........................................................................................................................................... 683
Section B.8. #4 Access Levels and Access Modifiers (Who Sees What).................................................................................................................................... 684
Section B.9. #4 Access Levels and Access Modifiers, cont......................................................................................................................................................... 684
Section B.10. #3 String and StringBuffer/StringBuilder Methods............................................................................................................................................ 686
Section B.11. #2 Multidimensional Arrays.................................................................................................................................................................................. 687
Section B.12. And the number one topic that didn't quite make it in... #1 Enumerations (also called Enumerated Types or Enums).................................. 688
Section B.13. Using "if" and "switch" with Enums..................................................................................................................................................................... 689
Section B.14. #1 Enumerations, completed................................................................................................................................................................................ 690
Section B.15. Five-Minute Mystery: A Long Trip Home............................................................................................................................................................. 691
Section B.16. Five-Minute Mystery Solution.............................................................................................................................................................................. 692
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
+HDG)LUVW-DYD
6HFRQG(GLWLRQ
BY +ATHY 3IERRA AND "ERT "ATES
#OPYRIGHT BY /2EILLY -EDIA )NC !LL RIGHTS RESERVED
0RINTED IN THE 5NITED 3TATES OF !MERICA
0UBLISHED BY /2EILLY -EDIA )NC 'RAVENSTEIN (IGHWAY .ORTH 3EBASTOPOL #!
/2EILLY -EDIA BOOKS MAY BE PURCHASED FOR EDUCATIONAL BUSINESS OR SALES PROMOTIONAL USE
/NLINE EDITIONS ARE ALSO AVAILABLE FOR MOST TITLES SAFARIOREILLYCOM &OR MORE INFORMATION
CONTACT OUR CORPORATEINSTITUTIONAL SALES DEPARTMENT
OR CORPORATE OREILLYCOM
(GLWRU
&RYHU'HVLJQHU
-IKE ,OUKIDES
%DIE &REEDMAN
,QWHULRU'HVLJQHUV +ATHY 3IERRA AND "ERT "ATES
3ULQWLQJ+LVWRU\
-AY
&IRST %DITION
&EBRUARY
3ECOND %DITION
9OU MIGHT WANT TO PICK UP A COPY OF BOTH EDITIONS FOR YOUR KIDS 4HINK E"AY
)3".
;-=
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
4O OUR BRAINS FOR ALWAYS BEING THERE
Licensed by
Eduard Simons
104038
DESPITE SHAKY EVIDENCE
Head First Java, 2nd Edition. Head First Java, 2nd Edition, ISBN: 0596009208
Prepared for e.simons@icarin.fiuc.org, Eduard Simons
Copyright 2005 Bert Bates and Kathy Sierra. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use
requires prior written consent from the copyright owner. Unauthorized use, reproduction and/or distribution are strictly prohibited and violate applicable laws. All rights reserved.
:KDWWKH\UHVD\LQJDERXW+HDG)LUVW
!MAZON NAMED (EAD &IRST *AVA
A 4OP 4EN %DITORS #HOICE FOR
#OMPUTER "OOKS OF
lRST EDITION
3OFTWARE $EVELOPMENT -AGAZINE NAMED
(EAD &IRST *AVA A lNALIST FOR THE TH !NNUAL
*OLT #OLA0RODUCT %XCELLENCE !WARDS
h+ATHY AND "ERTS @(EAD &IRST *AVA TRANSFORMS THE PRINTED PAGE INTO THE CLOSEST THING TO A '5) YOUVE
EVER SEEN )N A WRY HIP MANNER THE AUTHORS MAKE LEARNING *AVA AN ENGAGING @WHATRE THEY GONNA DO
NEXT EXPERIENCEv