[ Team LiB ] • • • Table of C ontents Index Examples Programmer's Guide to Java™ Certification, A : A Comprehensive Primer, Second Edition By Khalid A Mughal, Rolf W Rasm ussen Publisher: Pub Date: ISBN: Pages: Addison W esley August 04, 2003 0-201-72828-1 672 To pass the Sun Certified Program m er for Java Platform 1.4 ex am (SCPJ2 1.4) you need this book It is written for any ex perienced program m er (with or without previous k nowledge of Java) interested in m astering the Java program m ing language and passing the SCPJ2 1.4 ex am A Programmer's Guide to Java(TM) Certification, Second Edition, contains detailed coverage of all ex am topics and objectives, helpful code ex am ples, ex ercises, review questions, and several full practice ex am s In addition, as a com prehensive prim er to the Java program m ing language, this book is an invaluable reference tool for the reader This new edition has been thoroughly updated to focus on the latest version of the ex am (CX-310-035) In particular, it contains m ore in-depth ex planations of the syntax and usage of core language features that are now em phasized on the ex am The accom panying CD contains a version of the SCPJ2 1.4 Ex am Sim ulator developed by W hizlabs Software, which includes several m ock ex am s and sim ulates the ex am -tak ing ex perience The CD also contains the com plete source code for all the ex am ples, and solutions to the program m ing ex ercises W hat you will find in this book : Ex tensive coverage of all the objectives defined for the Sun Certified Program m er for Java Platform 1.4 ex am Easy-to-follow structure with chapters organized according to the ex am objectives as laid out by Sun Microsystem s Sum m aries that clearly state and differentiate the ex am objectives and the supplem entary objectives to be covered in each chapter A list of Sun's objectives for the SCPJ2 1.4 ex am , and a guide to tak ing the ex am A com plete m ock ex am with new questions (not repeats of review questions) Num erous ex am -relevant review questions to test your understanding of each m ajor topic, with annotated answers Program m ing ex ercises and solutions at the end of each chapter Copious code ex am ples illustrating concepts where the code has been com piled and thoroughly tested on m ultiple platform s Program output dem onstrating ex pected results from running the ex am ples Ex tensive use of UML (Unified Modeling Language) for illustration purposes An introduction to basic term inology and concepts in object-oriented program m ing Advice on how to avoid com m on pitfalls in m astering the language and tak ing the ex am Platform -independent coverage platform -specific details are provided where relevant Inform ation about the SCPJ2 Upgrade ex am [ Team LiB ] [ Team LiB ] • • • Table of C ontents Index Examples Programmer's Guide to Java™ Certification, A : A Comprehensive Primer, Second Edition By Khalid A Mughal, Rolf W Rasm ussen Publisher: Addison W esley Pub Date: August 04, 2003 ISBN: 0-201-72828-1 Pages: 672 Copyright List of Figures List of Tables List of Ex am ples Foreword Preface W riting the Second Edition About This Book Using the Book Review Q uestions Chapter Sum m ary Program m ing Ex ercises Book W eb Sites Request for Feedback About the Authors Ack nowledgm ents (First Edition) Ack nowledgm ents (Second Edition) Chapter Basics of Java Program m ing Section 1.1 Introduction Section 1.2 Classes Section 1.3 O bjects Section 1.4 Instance Mem bers Section 1.5 Static Mem bers Section 1.6 Inheritance Section 1.7 Aggregation Section 1.8 Tenets of Java Review Q uestions Section 1.9 Java Program s Section 1.10 Sam ple Java Application Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter Language Fundam entals Section 2.1 Basic Language Elem ents Review Q uestions Section 2.2 Prim itive Data Types Review Q uestions Section 2.3 Variable Declarations Section 2.4 Initial Values for Variables Review Q uestions Section 2.5 Java Source File Structure Review Q uestions Section 2.6 The main() Method Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter O perators and Assignm ents Section 3.1 Precedence and Associativity Rules for O perators Section 3.2 Evaluation O rder of O perands Section 3.3 Conversions Section 3.4 Sim ple Assignm ent O perator = Review Q uestions Section 3.5 Arithm etic O perators: *, /, %, +, Review Q uestions Section 3.6 The Binary String Concatenation O perator + Section 3.7 Variable Increm ent and Decrem ent O perators: ++, -Review Q uestions Section 3.8 Boolean Ex pressions Section 3.9 Relational O perators: = Section 3.10 Equality Section 3.11 Boolean Logical O perators: !, ^, &, | Section 3.12 Conditional O perators: &&, || Review Q uestions Section 3.13 Integer Bitwise O perators: ~, &, |, ^ Section 3.14 Shift O perators: , >>> Section 3.15 The Conditional O perator: ? Section 3.16 O ther O perators: new, [], instanceof Review Q uestions Section 3.17 Param eter Passing Section 3.18 Passing Prim itive Data Values Section 3.19 Passing O bject Reference Values Section 3.20 Passing Array References Section 3.21 Array Elem ents as Actual Param eters Section 3.22 final Param eters Section 3.23 Program Argum ents Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter Declarations and Access Control Section 4.1 Arrays Review Q uestions Section 4.2 Defining Classes Section 4.3 Defining Methods Section 4.4 Constructors Section 4.5 Scope Rules Review Q uestions Section 4.6 Pack ages Section 4.7 Accessibility Modifiers for Top-level Classes and Interfaces Section 4.8 O ther Modifiers for Classes Review Q uestions Section 4.9 Mem ber Accessibility Modifiers Review Q uestions Section 4.10 O ther Modifiers for Mem bers Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter Control Flow, Ex ception Handling, and Assertions Section 5.1 O verview of Control Flow Statem ents Section 5.2 Selection Statem ents Review Q uestions Section 5.3 Iteration Statem ents Section 5.4 Transfer Statem ents Review Q uestions Section 5.5 Stack -based Ex ecution and Ex ception Propagation Section 5.6 Ex ception Types Section 5.7 Ex ception Handling: try, catch, and finally Section 5.8 throw Statem ent Section 5.9 throws Clause Review Q uestions Section 5.10 Assertions Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter O bject-oriented Program m ing Section 6.1 Single Im plem entation Inheritance Review Q uestions Section 6.2 O verriding and Hiding Mem bers Review Q uestions Section 6.3 Chaining Constructors Using this() and super() Review Q uestions Section 6.4 Interfaces Review Q uestions Section 6.5 Com pleting the Type Hierarchy Section 6.6 Assigning, Passing, and Casting Reference Values Review Q uestions Section 6.7 Polym orphism and Dynam ic Method Look up Review Q uestions Section 6.8 Inheritance vs Aggregation Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter Nested Classes And Interfaces Section 7.1 O verview of Nested Classes and Interfaces Section 7.2 Static Mem ber Classes and Interfaces Section 7.3 Non-static Mem ber Classes Review Q uestions Section 7.4 Local Classes Section 7.5 Anonym ous Classes Review Q uestions Chapter Sum m ary Program m ing Ex ercise Chapter O bject Lifetim e Section 8.1 Garbage Collection Review Q uestions Section 8.2 Initializers Review Q uestions Chapter Sum m ary Chapter Threads Section 9.1 Multitask ing Section 9.2 O verview of Threads Section 9.3 Thread Creation Review Q uestions Section 9.4 Synchronization Review Q uestions Section 9.5 Thread Transitions Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter 10 Fundam ental Classes Section 10.1 O verview of the java.lang Pack age Section 10.2 The Object Class Review Q uestions Section 10.3 The W rapper Classes Review Q uestions Section 10.4 The Math Class Review Q uestions Section 10.5 The String Class Review Q uestions Section 10.6 The StringBuffer Class Review Q uestions Chapter Sum m ary Program m ing Ex ercises Chapter 11 Collections and Maps Section 11.1 The Collections Fram ework Section 11.2 Collections Review Q uestions Section 11.3 Sets Section 11.4 Lists Review Q uestions Section 11.5 Maps Section 11.6 Sorted Sets and Sorted Maps Review Q uestions Section 11.7 Im plem enting the equals(), hashCode(), and compareTo() Methods Section 11.8 W ork ing with Collections Review Q uestions Chapter Sum m ary Program m ing Ex ercises Appendix A Tak ing the SCPJ2 1.4 Ex am Section A.1 Preparing for the Program m er Ex am Section A.2 Registering for the Ex am Section A.3 How the Ex am ination Is Conducted Section A.4 The Q uestions Section A.5 Moving on to the Developer Ex am Appendix B O bjectives for the SCPJ2 1.4 Ex am Section 1: Declarations and Access Control (Chapter 4) Section 2: Flow Control, Assertions, and Ex ception Handling (Chapter 5) Section 3: Garbage Collection (Chapter 8) Section 4: Language Fundam entals (Chapter 2) Section 5: O perators and Assignm ents (Chapter 3) Section 6: O verloading, O verriding, Runtim e Type and O bject O rientation (Chapter 6, Chapter 11) Section 7: Threads (Chapter 9) Section 8: Fundam ental Classes in the java.lang Pack age (Chapter 10) Section 9: The Collections Fram ework (Chapter 11) Appendix C O bjectives for the Java Platform Upgrade Ex am Section 1: Declarations and Access Control Section 2: Flow Control, Assertions, and Ex ception Handling Section 3: Garbage Collection Section 4: Language Fundam entals Section 5: O perators and Assignm ents Section 6: O verloading, O verriding, Runtim e Type and O bject O rientation Section 7: Threads Section 8: The Collections Fram ework Appendix D Annotated Answers to Review Q uestions Section Basics of Java Program m ing Section Language Fundam entals Section O perators and Assignm ents Section Declarations and Access Control Section Control Flow, Ex ception Handling, and Assertions Section O bject-oriented Program m ing Section Nested Classes and Interfaces Section O bject Lifetim e Section Threads Section 10 Fundam ental Classes Section 11 Collections and Maps Appendix E Solutions to Program m ing Ex ercises Section Basics of Java Program m ing Section Language Fundam entals Section O perators and Assignm ents Section Declarations and Access Control Section Control Flow, Ex ception Handling, and Assertions Section O bject-oriented Program m ing Section Nested Classes and Interfaces Section Basics of Java Program m ing Section Threads Section 10 Fundam ental Classes Section 11 Collections and Maps Appendix F Mock Ex am Answers to Q uestions Appendix G Num ber System s and Num ber Representation Section G.1 Num ber System s Section G.2 Relationship between Binary, O ctal, and Hex adecim al Num bers Section G.3 Converting Decim als Section G.4 Representing Integers Appendix H About the CD Section H.1 W hizlabs Ex am Sim ulators Section H.2 Item s from the Book Single-User License Agreem ent Im portant Term s of Agreem ent Tenure of the License Agreem ent Lim ited W arranty Under the License Rem edies Provided Under the License Liabilities Under the License O ther Lim itations Under the License General Note Index [ Team LiB ] [ Team LiB ] Copyright Many of the designations used by m anufacturers and sellers to distinguish their products are claim ed as tradem ark s W here those designations appear in this book , and Addison-W esley was aware of a tradem ark claim , the designations have been printed with initial capital letters or in all capitals The authors and publisher have tak en care in the preparation of this book , but m ak e no ex pressed or im plied warranty of any k ind and assum e no responsibility for errors or om issions No liability is assum ed for incidental or consequential dam ages in connection with or arising out of the use of the inform ation or program s contained herein The publisher offers discounts on this book when ordered in quantity for bulk purchases and special sales For m ore inform ation, please contact: U.S Corporate and Governm ent Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact: International Sales (317) 581-3793 international@pearsontechgroup.com Visit Addison-W esley on the W eb: www.awprofessional.com Library of Congress Cataloging-in-Publication Data is available Copyright © 2004 by Pearson Education, Inc All rights reserved No part of this publication m ay be reproduced, stored in a retrieval system , or transm itted, in any form , or by any m eans, electronic, m echanical, photocopying, recording, or otherwise, without the prior consent of the publisher Printed in the United States of Am erica Published sim ultaneously in Canada For inform ation on obtaining perm ission for use of m aterial from this work , please subm it a written request to: Pearson Education, Inc Rights and Contracts Departm ent 75 Arlington Street, Suite 300 Boston, MA 02116 Fax : (617) 848-7047 Tex t printed on recycled paper 10—CRS—0706050403 First printing, August 2003 Dedication To the loving memory of my mother, Zubaida Begum, and my father, Mohammed Azim —K A.M For Olivia E Rasmussen and Louise J Dahlmo —R.W R [ Team LiB ] [ Team LiB ] List of Figures Chapter 1.1 UML Notation for Classes 1.2 UML Notation for O bjects 1.3 Aliases 1.4 Class Diagram Showing Static Mem bers of a Class 1.5 Mem bers of a Class 1.6 Class Diagram Depicting Inheritance Relation 1.7 Class Diagram Depicting Aggregation Chapter 2.1 Prim itive Data Types in Java 2.2 Java Source File Structure Chapter 3.1 W idening Num eric Conversions 3.2 O verflow and Underflow in Floating-point Arithm etic 3.3 Num eric Prom otion in Arithm etic Ex pressions 3.4 Param eter Passing: Prim itive Data Values 3.5 Param eter Passing: O bject Reference Values 3.6 Param eter Passing: Arrays Chapter 4.1 Array of Arrays 4.2 Block Scope 4.3 Pack age Hierarchy 4.4 Public Accessibility 4.5 Protected Accessibility 4.6 Default Accessibility 4.7 Private Accessibility Chapter 5.1 Activity Diagram for if Statem ents 5.2 Activity Diagram for switch Statem ent 5.3 Activity Diagram for while Statem ent 5.4 Activity Diagram for do-while Statem ent 5.5 Activity Diagram for the for Statem ent 5.6 Method Ex ecution 5.7 Ex ception Propagation 5.8 Partial Ex ception Inheritance Hierarchy 5.9 try-catch-finally Block 5.10 Ex ception Handling (Scenario 1) 5.11 Ex ception Handling (Scenario 2) 5.12 Ex ception Handling (Scenario 3) 5.13 Ex ecution of the Sim ple assert Statem ent (W hen Assertions Are Enabled) Chapter 6.1 Inheritance Hierarchy 6.2 Inheritance Relationship between String and Object Classes 6.3 Inheritance Relations 6.4 Reference Type Hierarchy 6.5 Polym orphic Methods 6.6 Im plem enting Data Structures by Inheritance and Aggregation Chapter 7.1 Static Mem ber Classes and Interfaces 7.2 O uter O bject with Associated Inner O bjects Chapter 8.1 Mem ory O rganization at Runtim e Chapter 9.1 Spawning Threads Using a Runnable O bject 9.2 Spawning Threads—Ex tending the Thread Class 9.3 Thread States 9.4 Running and Yielding 9.5 Sleeping and W ak ing up 9.6 W aiting and Notifying 9.7 Thread Com m unication 9.8 Stack Users 9.9 Joining of Threads 9.10 Deadlock Chapter 10 10.1 Partial Inheritance Hierarchy in the java.lang Pack age 10.2 Converting Values between Prim itive, W rapper, and String Types Chapter 11 11.1 The Core Interfaces 11.2 The Core Collection Interfaces and Their Im plem entations 11.3 The Core Map Interfaces and Their Im plem entations 11.4 Bulk O perations on Collections G.1 Converting between Binary, O ctal, and Hex adecim al [ Team LiB ] [ Team LiB ] List of Tables Chapter 1.1 Term inology for Class Mem bers Chapter 2.1 Keywords in Java 2.2 Reserved Literals in Java 2.3 Reserved Keywords not Currently in Use 2.4 Ex am ples of Literals 2.5 Ex am ples of Decim al, O ctal, and Hex adecim al Literals 2.6 Ex am ples of Unicode Values 2.7 Escape Sequences 2.8 Ex am ples of Escape Sequence \ddd 2.9 Range of Integer Values 2.10 Range of Character Values 2.11 Range of Floating-point Values 2.12 Boolean Values 2.13 Sum m ary of Prim itive Data Types 2.14 Default Values Chapter 3.1 O perator Sum m ary 3.2 Ex am ples of Truncated Values 3.3 Arithm etic O perators 3.4 Ex am ples of Arithm etic Ex pression Evaluation 3.5 Arithm etic Com pound Assignm ent O perators 3.6 Relational O perators 3.7 Prim itive Data Value Equality O perators 3.8 Reference Equality O perators 3.9 Boolean Logical O perators 3.10 Truth-values for Boolean Logical O perators 3.11 Boolean Logical Com pound Assignm ent O perators 3.12 Conditional O perators 3.13 Truth-values for Conditional O perators 3.14 Integer Bitwise O perators 3.15 Result Table for Bitwise O perators 3.16 Ex am ples of Bitwise O perations 3.17 Bitwise Com pound Assignm ent O perators 3.18 Shift O perators 3.19 Shift Com pound Assignm ent O perators 3.20 Param eter Passing Chapter 4.1 Accessing Mem bers within a Class 4.2 Sum m ary of Accessibility Modifiers for Classes and Interfaces 4.3 Sum m ary of O ther Modifiers for Classes and Interfaces 4.4 Sum m ary of Accessibility Modifiers for Mem bers 4.5 Sum m ary of O ther Modifiers for Mem bers Chapter 5.1 return Statem ent 5.2 Granularities for Enabling and Disabling Assertions at Runtim e 5.3 Enabling and Disabling Assertions in All System Classes at Runtim e Chapter 6.1 Types and Values Chapter 7.1 O verview of Classes and Interfaces Chapter Chapter Chapter 10 10.1 Applying Rounding Functions Chapter 11 11.1 Core Interfaces in the Collections Fram ework 11.2 Sum m ary of Collection and Map Im plem entations 11.3 Bulk O perations and Set Logic G.1 Num ber System s G.2 Representing Signed byte Values Using 2's Com plem ent [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] pack age accessibility accessibility:pack age pack ages:accessibility [See pack age accessibility] pack age statem ent k eywords:pack age pack ages hierarchy java.lang java.util m em bers nam ing schem e short-hand unnam ed pack ages:definition definitions:pack ages pack age statem ent; pack ages:statem ent [See pack age statem ent] param eters array elem ents arrays form al [See form al param eters] prim itives references param eters:actual variables:param eters param eters:conversions on passing conversions:param eter passing param eters:passing passing:param eters param eters:this param eters:im plicit parent class classes:parent parentheses parseType m ethod parsing num eric values types:parsing 2nd partial im plem entation partly synchronizing a m ethod passing:m essages m essage:passing objects:com m unication;com m unication passing:references references:passing paths of ex ecution persistent objects objects:persistent storing objects polym orphism 2nd 3rd 4th 5th positive zero zero:positive postconditions assertions:postconditions postfix operators operators:postfix power raised to power precedence rules precision preconditions assertions:preconditions predefined literals preem pted threads preem ptive scheduling Preface prefix 2nd 2nd 0x 2nd prim itive types prim itive values equality prim itive values:assignm ent assignm ents:prim itive values prim itive values:passing prim itive types: [See also prim itive values[prim itive types:zzz]] priorities threads:priorities 2nd priority of thread private private m em bers k eywords:private accessibility:private process-based m ultitask ing processes program application com m and line program argum ents param eters:program param eters:m ain m ethod;m ain m ethod argum ents program m er ex am properties attributes see properties properties: [See also class m em bers] protected protected m em bers k eywords:protected accessibility:protected prototypes of m ethods m ethods:prototypes public public m em bers k eywords:public accessibility:public [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] questions quotation m ark 2nd [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] race condition radians radix [See base] random num ber pseudorandom num ber range-view collections\:range-views collections\:views range\ character values floating-point values integer values Ready-to-run state threads:Ready-to-run state reclaim ing m em ory reducing com plex ity reference objects 2nd reference type reference values reference variable 2nd references 2nd 3rd 4th 5th 6th 7th abstract types casting equality reachable 2nd variables:object reference variables:references references:assignm ent conversion:reference assignm ent references:this references:super referent relational operators operators:relational operators:boolean rem ainder operator:% operators:% replacing characters strings\:replacing reserved k eywords goto resources resurrecting objects objects:resurrection retaining elem ents collections\:retaining elem ents return statem ent k eywords:return control flow:return; m ethods:return; m ethods:term ination; statem ents:return return value rhym ing order right associativity associativity right-m ost bit ripple effect role relationship Round-Robin scheduling rounding functions rounding num bers round m ethod Runnable interface threads:Runnable 2nd running out of m em ory Running state threads:Running state runtim e bounds check ing runtim e check s Runtim e class runtim e environm ent runtim e stack Runtim eEx ception [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] schedulers scientific notation literals:scientific notation scope catch block scope:class classes:scope search k ey searching searching in string characters:searching for substring searching; strings:searching SecurityManager class selection statem ents statem ents:selection conditional:statem ents; statem ents:conditional sem antic definition sem icolon em pty statem ent statem ents:em pty sequence services objects:services set 2nd shallow copying shared resource shift:distance distance of shift shift:operators shifting operators:shift;operators:bitwise;bitwise:shifting;bit shifting shift\:left left\:shift short k eywords\:short integers\: short; types\:short short-circuit operators:short-circuited short-circuit:evaluation evaluation short-circuits shuffle elem ents perm ute elem ents random order; collections\:shuffle elem ents 2nd sign fill signature m ethods:signature 2nd signed shift sim ple:assignm ent operator assignm ents:operator operators:assignm ent;operators: = sim ple:statem ent statem ents:sim ple single im plem entation inheritance 2nd 3rd single-line com m ent single-quotes single-valued m aps singleton set collections:singleton set sk eletal source file Sleeping state threads:Sleeping state 2nd sleeping state threads:sleeping state sorted m ap 2nd collections:SortedMap sorted set 2nd collections:SortedSet 2nd sorting collections\:sorting 2nd source file 2nd file structure spaces special character values specialization specialized classes classes:specialized square root stack stack trace statem ents break return statem ents: labeled labels labels: labeled statem ent static initializer block m ethods 2nd variable initialization static contex t static code: [See static contex t]2nd [See static contex t] static factory m ethods factory m ethods static field static initializer static k eyword k eywords:static static m em ber classes classes:static m em ber nested classes:static m em ber static m em ber classes:full nam e non-static m em ber classes:full nam e nested classes:full nam e static m em bers 2nd classes:static m em bers m em bers:static static:m em bers [See static m em bers] static variables 2nd static:variables [See static variables] static\ m ethods string buffer capacity String class strings string literals interned StringBuffer class strings:buffers strings appending capacity changing case com paring concatenation operator + 2nd deleting individual characters inserting lex icographical order strings:com paring strings:natural order strings:concatenation concatenation operator operators:string concatenation;operators: + strings:constructing string buffer:constructing strings:initializing strings:creating strings:literals literals:string strings\ charAt com pareTo concat equals 2nd getChars ignoring case in com parison index O f individual characters length 2nd trim strong references references: strong strongly typed language subclass 2nd classes:subclass 2nd subinterface subm ap view subpack age subset 2nd collections\:subset substrings strings:substrings ex tracting substrings; strings:ex tracting substrings subtype suffix D F L Sun Educational Services super construct super:k eyword k eywords:super super:reference references:super super:k eyword; k eywords:super superclass classes:superclass 2nd superclass-subclass relationship superinterfaces superset supertypes switch:break break statem ent switching between threads threads:switching Sylvan Prom etric synchronization threads:synchronization synchronized:block s constructs: synchronized block s 2nd 3rd synchronized:k eyword k eywords:synchronized threads:synchronized; m ethods:synchronized; synchronized: m ethods syntactically legal System class system classes 2nd [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] TABsee Horizontal tab tabs tabulators tail m ap view tail set view technology architect ex am architect ex am telephone directory order term inating loops ternary conditional operator operators:ternary 2nd testing locations tex tual representation this special form this() constructor call 2nd thread live Thread class threads:class threads:Thread class thread creation creating:threads thread of ex ecution thread safety thread-based m ultitask ing thread-safe thread-safe collections collections:thread-safety ThreadDeath threads alive block ed code ex ecuted death im plem ented by inner classes notification running scheduler starting status synchronization threads:creation creating:threads threads:sleeping sleeping threads:starting starting threads threads:transitions threads:states threads:yielding yielding threads\ nam es threads\:alive live threads threads\:joining joining threads threads\:notifying notifying threads 2nd throw statem ent k eywords:throw statem ents:throw; ex ceptions: throw; control flow:throw Throwable class 2nd throwing ex ceptions ex ceptions:throwing [See throwing ex ceptions] throws clause k eywords:throws m ethods:throws clause tim e-sliced scheduling tok ens top level classes toString m ethod 2nd m ethods\:toString tex tual representation total order transfer statem ents statem ents:transfer control flow: transfer statem ents; control transfer; statem ents:control transfer tree m ap collections:TreeMap tree set collections:TreeSet trigonom etry functions true literal literals:true reserved literals:true truth-values 2nd try-catch-finally construct type hierarchy type safe conversions:type safe types byte com patibility floating-point int interface long short wrappers [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] UML aggregation UML: [See also diagram s [UML:zzz]] UML:accessibility accessibility:UML UML\ classes inheritance unary num eric prom otion num eric prom otions:unary unary operators operators: unary operators:unary uncaught ex ceptions ex ceptions:uncaught unchangeable variables uncheck ed ex ceptions ex ceptions:uncheck ed underflow Unicode character set:Unicode Unified Modeling Language [See UML] union unsafe casts conversions:unsafe casts unsupported operations collections:unsupported operations unused k eywords reserved k eywords k eywords:reserved words; k eywords: unused words upcasting casting:upcasting reference:upcasting user threads threads:user using arrays arrays:using using pack ages pack ages:using [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] value objects valueO f m ethod 2nd 3rd m ethods\:valueO f values constants values: [See also variables [values:zzz]] wrap-around variable declarations 2nd variable declarations variables declarations see variable declarations declarations:variables see variable declarations variable initialization variables:initialization [See variable initialization] variables lifetim e param eters static storing variable declarations initialization:variables; using variables Venn diagram s view of list sublist collections\:views; range-view VirtualMachineError void k eywords:void Void wrapper class [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] wait set waiting for conditions waiting for notification state threads: waiting for notification state white space trim rem ove white space whole-part relationship widening conversions conversions:widening prim itive widening conversions:reference reference:widening conversions wrapper classes 2nd classes:wrappers 2nd [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] x or bitwise\:x or integers\:x or logical\:x or [ Team LiB ] [ Team LiB ] [SYMBO L] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O ] [P] [Q ] [R] [S] [T] [U] [V] [W ] [X] [Z] zero fill shift [ Team LiB ] Brought to You by Like the book? Buy it! ... is also the principal author of an introductory Norwegian tex tbook on program m ing in Java (Java som første programmeringsspråk /Java as First Programming Language, Cappelen Ak adem isk Forlag,... as a handy language guide The book also has an appendix devoted to the SCPJ2 Upgrade ex am To facilitate preparation for the ex am s, the second edition com es with a CD containing additional... necessary level of academ ic rigor to an area m uch in need of it, while retaining an essentially pragm atic flavor The m aterial in this book is probably all you need to pass the Java certification