A Programmer's Guide to Java? Certification - Khalid A. Mughal, Rolf W Rasmussen

A Programmer's Guide to Java? Certification

A Comprehensive Primer
Media-Kombination
672 Seiten
2003 | 2nd edition
Addison Wesley
978-0-201-72828-6 (ISBN)
56,85 inkl. MwSt
zur Neuauflage
  • Titel erscheint in neuer Auflage
  • Artikel merken
Zu diesem Artikel existiert eine Nachauflage
Useful for Sun Certified Programmer for Java 2 Platform 1.4 exam (SCPJ2 1.4). This work offers coverage of exam topics and objectives, helpful code examples, exercises, review questions, and several practice exams. It contains explanations of the syntax and usage of core language features. It gives advice on how to avoid common pitfalls.

Khalid A. Mughal is an associate professor at the Department of Informatics at the University of Bergen, Norway. During his extensive career, he has designed and implemented many courses on Java, object-oriented system development, and compiler techniques. He has also given seminars for the IT industry. He is the principal author of Java Som Forste Programmeringssprak (Java as a First Programming Language) published by Cappelen Akademisk Forlag, 2002. Rolf W. Rasmussen is a system developer at Vizrt, a company that develops real-time graphics systems for TV, films, and the Web. Previously, he has worked on clean room implementations of the Java class libraries. He is coauthor, with Professor Mughal, of Java Som Forste Programmeringssprak. 0201728281AB07152003

List of Tables.


List of Examples.


List of Figures.


Foreword.


Preface.


Writing the Second Edition.



About This Book.



Using the Book.



Book Web Sites.



Request for Feedback.



About the Authors.



Acknowledgments (First Edition).



Acknowledgments (Second Edition).



1. Basics of Java Programming.


Introduction.



Classes.



Declaring Members: Fields and Methods.



Objects.



Class Instantiation.



Object References.



Instance Members.



Invoking Methods.



Static Members.



Inheritance.



Aggregation.



Tenets of Java.



Review Questions.



Java Programs.



Sample Java Application.



Essential Elements of a Java Application.



Compiling and Running an Application.



Review Questions.



Chapter Summary.



Programming Exercises.



2. Language Fundamentals.


Basic Language Elements.



Lexical Tokens.



Identifiers.



Keywords.



Literals.



Integer Literals.



Floating-point Literals.



Boolean Literals.



Character Literals.



String Literals.



White Spaces.



Comments.



Review Questions.



Primitive Data Types.



Integer Types.



Character Type.



Floating-point Types.



Boolean Type.



Review Questions.



Variable Declarations.



Declaring and Initializing Variables.



Object Reference Variables.



Lifetime of Variables.



Initial Values for Variables.



Default Values for Fields.



Initializing Local Variables of Primitive Data Types.



Initializing Local Reference Variables.



Review Questions.



Java Source File Structure.



Review Questions.



The main() Method.



Review Questions.



Chapter Summary.



Programming Exercises.



3. Operators and Assignments.


Precedence and Associativity Rules for Operators.



Evaluation order of operands.



Conversions.



Unary Cast Operator: (type).



Narrowing and Widening Conversions.



Numeric Promotions.



Type Conversion Contexts.



Simple Assignment Operator =.



Assigning Primitive Values.



Assigning References.



Multiple Assignments.



Numeric Type Conversions on Assignment.



Review Questions.



Arithmetic Operators: *, /, %, +, -.



Arithmetic Operator Precedence and Associativity.



Evaluation Order in Arithmetic Expressions.



Range of Numeric Values.



Unary Arithmetic Operators: -, +.



Multiplicative Binary Operators: *, /, %.



Additive Binary Operators: +, -.



Numeric Promotions in Arithmetic Expressions.



Arithmetic Compound Assignment Operators: *=, /=, %=, +=, -=.



Review Questions.



The Binary String Concatenation Operator +.



Variable Increment and Decrement Operators: ++, --.



Increment Operator ++.



Decrement Operator --.



Review Questions.



Boolean Expressions.



Relational Operators: <, <=, >, >=.



Equality.



Primitive Data Value Equality: ==, !=.



Object Reference Equality: ==, !=.



Object Value Equality.



Boolean Logical Operators: !, ^, &, |.



Operand Evaluation for Boolean Logical Operators.



Boolean Logical Compound Assignment Operators: &=, ^=, |=.



Conditional Operators: &&, ||.



Short-circuit Evaluation.



Review Questions.



Integer Bitwise Operators: ~, &, |, ^.



Bitwise Compound Assignment Operators: &=, ^=, |=.



Shift Operators: <<, >>, >>>.



The Shift-left Operator <<.



The Shift-right-with-sign-fill Operator >>.



The Shift-right-with-zero-fill Operator >>>.



Shift Compound Assignment Operators: <<=, >>=, >>>=.



The Conditional Operator ? :.



Other Operators: new, [], instanceof.



Review Questions.



Parameter Passing.



Passing Primitive Data Values.



Passing Object Reference Values.



Passing Array References.



Array Elements as Actual Parameters.



final Parameters.



Program Arguments.



Review Questions.



Chapter Summary.



Programming Exercises.



4. Declarations and Access Control.


Arrays.



Declaring Array Variables.



Constructing an Array.



Initializing an Array.



Using an Array.



Anonymous Arrays.



Multidimensional Arrays.



Review Questions.



Defining Classes.



Defining Methods.



Statements.



Instance Methods and Object Reference this.



Method Overloading.



Constructors.



Default Constructor.



Overloaded Constructors.



Scope Rules.



Class Scope for Members.



Block Scope for Local Variables.



Review Questions.



Packages.



Defining Packages.



Using Packages.



Compiling and Running Code from Packages.



Accessibility Modifiers for Top-level Classes and Interfaces.



Other Modifiers for Classes.



abstract Classes.



final Classes.



Review Questions.



Member Accessibility Modifiers.



public Members.



protected Members.



Default Accessibility for Members.



private Members.



Review Questions.



Other Modifiers for Members.



static Members.



final Members.



abstract Methods.



synchronized Methods.



native Methods.



transient Fields.



volatile Fields.



Review Questions.



Chapter Summary.



Programming Exercises.



5. Control Flow, Exception Handling and Assertions.


Overview of Control Flow Statements.



Selection Statements.



Simple if Statement.



if-else Statement.



switch Statement.



Review Questions.



Iteration Statements.



while Statement.



do-while Statement.



for Statement.



Transfer Statements.



Labeled Statements.



break Statement.



continue Statement.



return Statement.



Review Questions.



Stack-based Execution and Exception Propagation.



Exception Types.



Class Exception.



Class RuntimeException.



Class Error.



Checked and Unchecked Exceptions.



Defining New Exceptions.



Exception Handling: try, catch and finally.



try Block.



catch Block.



finally Block.



throw Statement.



throws Clause.



Review Questions.



Assertions.



assert Statement and AssertionError Class.



Compiling Assertions.



Runtime Enabling and Disabling of Assertions.



Using Assertions.



Review Questions.



Chapter Summary.



Programming Exercises.



6. Object-oriented Programming.


Single Implementation Inheritance.



Object-oriented Programming Concepts.



Review Questions.



Overriding and Hiding Members.



Instance Method Overriding.



Field Hiding.



Static Method Hiding.



Overriding vs. Overloading.



Object Reference super.



Review Questions.



Chaining Constructors using this() and super().



this() Constructor Call.



super() Constructor Call.



Review Questions.



Interfaces.



Defining Interfaces.



Method Prototype Declarations.



Implementing Interfaces.



Extending Interfaces.



Constants in Interfaces.



Review Questions.



Completing the Type Hierarchy.



Assigning, Passing and Casting Reference Values.



Reference Value Assignment Conversions.



Parameter Passing Conversions.



Reference Casting and instanceof Operator.



Converting References of Class and Interface Types.



Review Questions.



Polymorphism and Dynamic Method Lookup.



Review Questions.



Inheritance vs. Aggregation.



Encapsulation.



Choosing between Inheritance and Aggregation.



Review Questions.



Chapter Summary.



Programming Exercises.



7. Nested Classes and Interfaces.


Overview of Nested Classes and Interfaces.



Static Member Classes and Interfaces.



Declaring and Using Static Member Classes and Interfaces.



Accessing Members in Enclosing Context.



Non-static Member Classes.



Instantiating Non-static Member Classes.



Accessing Members in Enclosing Context.



Review Questions.



Local Classes.



Accessing Declarations in Enclosing Context.



Instantiating Local Classes.



Anonymous Classes.



Extending an Existing Class.



Implementing an Interface.



Instantiating Anonymous Classes.



Accessing Declarations in Enclosing Context.



Review Questions.



Chapter Summary.



Programming Exercise.



8. Object Lifetime.


Garbage Collection.



Reachable References.



Facilitating Garbage Collection.



Object Finalization.



Finalizer Chaining.



Invoking Garbage Collection.



Review Questions.



Initializers.



Field Initializer Expressions.



Static Initializer Blocks.



Instance Initializer Blocks.



Constructing Initial Object State.



Review Questions.



Chapter Summary.



9. Threads.


Multitasking.



Overview of Threads.



The Main Thread.



Thread Creation.



Implementing the Runnable Interface.



Extending the Thread Class.



Review Questions.



Synchronization.



Locks.



Synchronized Methods.



Synchronized Blocks.



Review Questions.



Thread Transitions.



Thread States.



Thread Priorities.



Thread Scheduler.



Running and Yielding.



Sleeping and Waking Up.



Waiting and Notifying.



Joining.



Blocking for I/O.



Thread Termination.



Deadlocks.



Review Questions.



Chapter Summary.



Programming Exercises.



10. Fundamental Classes.


Overview of the java.lang package.



The Object Class.



Review Questions.



The Wrapper Classes.



Common Wrapper Class Constructors.



Common Wrapper Class Utility Methods.



Numeric Wrapper Classes.



Character Class.



Boolean Class.



Review Questions.



The Math Class.



Miscellaneous Rounding Functions.



Exponential Functions.



Trigonometry Functions.



Pseudorandom Number Generator.



Review Questions.



The String Class.



Creating and Initializing Strings.



Reading Characters from a String.



Comparing Strings.



Character Case in a String.



Concatenation of Strings.



Searching for Characters and Substrings.



Extracting Substrings.



Converting Primitive Values and Objects to Strings.



Review Questions.



The StringBuffer Class.



Constructing String Buffers.



Reading and Changing Characters in String Buffers.



Constructing Strings from String Buffers.



Appending, Inserting and Deleting Characters in String Buffers.



Controlling String Buffer Capacity.



Review Questions.



Chapter Summary.



Programming Exercises.



11. Collections and Maps.


The Collections Framework.



Core interfaces.



Implementations.



Collections.



Basic Operations.



Bulk Operations.



Array Operations.



Iterators.



Review Questions.



Sets.



HashSet and LinkedHashSet.



Lists.



ArrayList, LinkedList and Vector.



Review Questions.



Maps.



Basic Operations.



Bulk Operations.



Collection Views.



HashMap, LinkedHashMap and Hashtable.



Sorted Sets and Sorted Maps.



The Comparator Interface.



The Comparable Interface.



The SortedSet Interface.



The SortedMap Interface.



TreeSet and TreeMap.



Review Questions.



Implementing the equals(), hashCode() and compareTo() methods.



The equals() method.



The hashCode() method.



The compareTo() method.



Working with Collections.



Synchronized Collection Decorators.



Unmodifiable Collection Decorators.



Sorting Collections.



Searching in Collections.



Singleton Collections.



Other Utility Methods in the Collections Class.



Utility Methods in the Arrays Class.



Abstract Implementations.



Review Questions.



Chapter Summary.



Programming Exercise.



Appendix A. Taking the SCPJ2 1.4 Exam.


Preparing for the programmer exam.



Registering for the exam.



Obtaining an Exam Voucher.



Signing Up for the Test.



Contact Information.



After Taking the Exam.



How the Examination Is Conducted.



The Testing Locations.



Utilizing the Allotted time.



The Exam Program.



The Questions.



Types of Questions Asked.



Types of answers expected.



Topics Covered by the Questions.



Moving on to the developer exam.



Appendix B. Objectives for the SCPJ2 1.4 Exam.


Appendix C. Objectives for the Java 2 Platform Upgrade Exam.


Appendix D. Annotated Answers to Review Questions.


Appendix E. Solutions to Programming Exercises.


Appendix F. Sample Exam.


Appendix G. Number Systems and Number Representation.


Number Systems.



Binary, Octal and Hexadecimal Number System.



Converting Binary Numbers to Decimals.



Converting Octal and Hexadecimal Numbers to Decimals.



Relationship between Binary, Octal and Hex Numbers.



Converting Decimals.



Converting Decimals to Binary Numbers.



Converting Decimals to Octal and Hexadecimal Numbers.



Representing Integers.



Calculating 2's Complement.



Appendix H. Using the CD.


Contents of the CD.



Installing the Programs.



Using the Programs.



Index. 0201728281T05222003

Erscheint lt. Verlag 4.9.2003
Verlagsort Boston
Sprache englisch
Maße 234 x 226 mm
Gewicht 1290 g
Themenwelt Informatik Programmiersprachen / -werkzeuge Java
Mathematik / Informatik Informatik Web / Internet
Informatik Weitere Themen Zertifizierung
ISBN-10 0-201-72828-1 / 0201728281
ISBN-13 978-0-201-72828-6 / 9780201728286
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich