A Programmer's Guide to Java Certification: A Comprehesive Primer, 2/e (Paperback)
暫譯: Java 認證程式設計師指南:全面入門,第 2 版 (平裝本)

Khalid A Mughal, Rolf W Rasmussen

  • 出版商: Addison Wesley
  • 出版日期: 2003-08-14
  • 定價: $1,650
  • 售價: 2.4$399
  • 語言: 英文
  • 頁數: 672
  • 裝訂: Paperback
  • ISBN: 0201728281
  • ISBN-13: 9780201728286
  • 相關分類: Java 程式語言
  • 立即出貨(限量) (庫存=4)

買這商品的人也買了...

相關主題

商品描述

To pass the Sun Certified Programmer for Java 2 Platform 1.4 exam (SCPJ2 1.4) you need this book. It is written for any experienced programmer (with or without previous knowledge of Java) interested in mastering the Java programming language and passing the SCPJ2 1.4 exam.

A Programmer's Guide to Java™ Certification, Second Edition, contains detailed coverage of all exam topics and objectives, helpful code examples, exercises, review questions, and several full practice exams. In addition, as a comprehensive primer to the Java programming 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 exam (CX-310-035). In particular, it contains more in-depth explanations of the syntax and usage of core language features that are now emphasized on the exam. The accompanying CD contains a version of the SCPJ2 1.4 Exam Simulator developed by Whizlabs Software, which includes several mock exams and simulates the exam-taking experience. The CD also contains the complete source code for all the examples, and solutions to the programming exercises.

What you will find in this book:

  • Extensive coverage of all the objectives defined for the Sun Certified Programmer for Java 2 Platform 1.4 exam
  • Easy-to-follow structure with chapters organized according to the exam objectives as laid out by Sun Microsystems
  • Summaries that clearly state and differentiate the exam objectives and the supplementary objectives to be covered in each chapter
  • A list of Sun's objectives for the SCPJ2 1.4 exam, and a guide to taking the exam
  • A complete mock exam with new questions (not repeats of review questions)
  • A CD that includes several mock exams and a version of the SCJP 1.4 Exam Simulator by Whizlabs Software, which simulates the exam-taking experience
  • Numerous exam-relevant review questions to test your understanding of each major topic, with annotated answers
  • Programming exercises and solutions at the end of each chapter
  • Copious code examples illustrating concepts where the code has been compiled and thoroughly tested on multiple platforms
  • Program output demonstrating expected results from running the examples
  • Extensive use of UML (Unified Modeling Language) for illustration purposes
  • An introduction to basic terminology and concepts in object-oriented programming
  • Advice on how to avoid common pitfalls in mastering the language and taking the exam
  • Platform-independent coverage--platform-specific details are provided where relevant
  • Information about the SCPJ2 Upgrade exam
  • Table of Contents

    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.

    商品描述(中文翻譯)

    為了通過 Sun Certified Programmer for Java 2 Platform 1.4 考試 (SCPJ2 1.4),您需要這本書。這本書是為任何有經驗的程式設計師(無論是否有 Java 的先前知識)而寫的,旨在幫助他們掌握 Java 程式語言並通過 SCPJ2 1.4 考試。

    A Programmer's Guide to Java™ Certification, Second Edition》詳細涵蓋了所有考試主題和目標,提供了有用的程式碼範例、練習題、複習問題以及幾個完整的模擬考試。此外,作為 Java 程式語言的綜合入門書籍,這本書對讀者來說是一個無價的參考工具。

    這一新版已全面更新,專注於考試的最新版本 (CX-310-035)。特別是,它包含了對現在在考試中強調的核心語言特性的語法和用法的更深入解釋。隨書附帶的 CD 包含由 Whizlabs Software 開發的 SCPJ2 1.4 考試模擬器版本,該模擬器包括幾個模擬考試並模擬考試的體驗。CD 還包含所有範例的完整源代碼和程式設計練習的解答。

    您在這本書中會找到的內容包括:
    - 廣泛涵蓋 Sun Certified Programmer for Java 2 Platform 1.4 考試定義的所有目標
    - 易於遵循的結構,章節根據 Sun Microsystems 所列的考試目標組織
    - 清楚陳述並區分考試目標和每章要涵蓋的補充目標的摘要
    - Sun 的 SCPJ2 1.4 考試目標列表,以及考試指南
    - 包含新問題的完整模擬考試(不是複習問題的重複)
    - 包含幾個模擬考試和 Whizlabs Software 的 SCJP 1.4 考試模擬器版本的 CD,模擬考試體驗
    - 許多與考試相關的複習問題,以測試您對每個主要主題的理解,並附有註解答案
    - 每章結尾的程式設計練習和解答
    - 大量程式碼範例,說明概念,這些程式碼已在多個平台上編譯和徹底測試
    - 程式輸出顯示運行範例的預期結果
    - 廣泛使用 UML(統一建模語言)作為插圖
    - 對物件導向程式設計的基本術語和概念的介紹
    - 如何避免掌握語言和參加考試時的常見陷阱的建議
    - 平台無關的涵蓋——在相關的地方提供平台特定的細節
    - 有關 SCPJ2 升級考試的信息

    目錄
    - 表格列表
    - 範例列表
    - 圖形列表
    - 前言
    - 序言

    撰寫第二版
    - 本書介紹
    - 使用本書
    - 書籍網站
    - 反饋請求
    - 作者介紹
    - 感謝詞(第一版)
    - 感謝詞(第二版)

    1. Java 程式設計基礎
    - 介紹
    - 類別
    - 成員宣告:欄位和方法
    - 物件
    - 類別實例化
    - 物件參考
    - 實例成員
    - 調用方法
    - 靜態成員
    - 繼承
    - 聚合
    - Java 的基本原則
    - 複習問題
    - Java 程式
    - 範例 Java 應用程式
    - Java 應用程式的基本要素
    - 編譯和運行應用程式
    - 複習問題
    - 章節摘要
    - 程式設計練習

    2. 語言基礎
    - 基本語言元素
    - 詞法標記
    - 識別符
    - 關鍵字
    - 字面量
    - 整數字面量
    - 浮點字面量
    - 布林字面量
    - 字元字面量
    - 字串字面量
    - 空白字元
    - 註解
    - 複習問題
    - 原始資料類型
    - 整數類型
    - 字元類型
    - 浮點類型
    - 布林類型
    - 複習問題
    - 變數宣告
    - 宣告和初始化變數
    - 物件參考變數
    - 變數的生命週期
    - 變數的初始值
    - 欄位的預設值
    - 初始化原始資料類型的局部變數
    - 初始化局部參考變數
    - 複習問題
    - Java 源文件結構
    - 複習問題
    - main() 方法
    - 複習問題
    - 章節摘要
    - 程式設計練習

    3. 運算子和賦值
    - 運算子的優先順序和結合性規則
    - 操作數的評估順序
    - 轉換
    - 一元轉型運算子:(type)
    - 縮小和擴大轉換
    - 數值提升
    - 類型轉換上下文
    - 簡單賦值運算子 =
    - 賦值原始值
    - 賦值參考
    - 多重賦值
    - 賦值時的數值類型轉換
    - 複習問題
    - 算術運算子:*, /, %, +, -
    - 算術運算子的優先順序和結合性
    - 算術表達式中的評估順序
    - 數值範圍
    - 一元算術運算子:-, +
    - 乘法二元運算子:*, /, %
    - 加法二元運算子:+, -
    - 算術表達式中的數值提升
    - 算術複合賦值運算子:*=, /=, %=, +=, -=
    - 複習問題
    - 二元字串串接運算子 +
    - 變數遞增和遞減運算子:++, --
    - 遞增運算子 ++
    - 遞減運算子 --
    - 複習問題
    - 布林表達式
    - 關係運算子:<, <=, >, >=
    - 相等性
    - 原始資料值相等性:==, !=
    - 物件參考相等性:==, !=
    - 物件值相等性
    - 布林邏輯運算子:!, ^, &, |
    - 布林邏輯運算子的操作數評估
    - 布林邏輯複合賦值運算子:&=, ^=, |=
    - 條件運算子:&&, ||
    - 短路評估
    - 複習問題
    - 整數位元運算子:~, &, |, ^
    - 位元複合賦值運算子:&=, ^=, |=
    - 移位運算子:<<, >>, >>>
    - 向左移位運算子 <<
    - 向右移位(帶符號填充)運算子 >>
    - 向右移位(帶零填充)運算子 >>>
    - 移位複合賦值運算子:<<=, >>=, >>>=
    - 條件運算子 ? :
    - 其他運算子:new, instanceof
    - 複習問題
    - 參數傳遞
    - 傳遞原始資料值
    - 傳遞物件參考值
    - 傳遞陣列參考
    - 陣列元素作為實際參數
    - final 參數
    - 程式參數
    - 複習問題
    - 章節摘要
    - 程式設計練習

    4. 宣告和存取控制
    - 陣列
    - 宣告陣列變數
    - 建構陣列
    - 初始化陣列
    - 使用陣列
    - 匿名陣列
    - 多維陣列
    - 複習問題
    - 定義類別
    - 定義方法
    - 語句
    - 實例方法和物件參考 this
    - 方法重載
    - 建構子
    - 預設建構子
    - 重載建構子
    - 範圍規則
    - 類別成員的範圍
    - 局部變數的區塊範圍
    - 複習問題
    - 套件
    - 定義套件
    - 使用套件
    - 編譯和運行來自套件的代碼
    - 顶级类和接口的可访问性修饰符
    - 類別的其他修飾符
    - 抽象類別
    - final 類別
    - 複習問題
    - 成員可訪問性修飾符
    - public 成員
    - protected 成員
    - 成員的預設可訪問性
    - private 成員
    - 複習問題
    - 成員的其他修飾符
    - 靜態成員
    - final 成員
    - 抽象方法
    - synchronized 方法
    - native 方法
    - transient 欄位
    - volatile 欄位
    - 複習問題
    - 章節摘要
    - 程式設計練習

    5. 控制流程、例外處理和斷言
    - 控制流程語句概述
    - 選擇語句
    - 簡單的 if 語句
    - if-else 語句
    - switch 語句
    - 複習問題
    - 迭代語句
    - while 語句
    - do-while 語句
    - for 語句
    - 轉移語句
    - 標籤語句
    - break 語句
    - continue 語句
    - return 語句
    - 複習問題
    - 基於堆疊的執行和例外傳播
    - 例外類型
    - Class Exception
    - Class RuntimeException
    - Class Error
    - 已檢查和未檢查的例外
    - 定義新例外
    - 例外處理:try、catch 和 finally
    - try 區塊
    - catch 區塊
    - finally 區塊
    - throw 語句
    - throws 子句
    - 複習問題
    - 斷言
    - assert 語句和 AssertionError 類
    - 編譯斷言
    - 斷言的運行時啟用和禁用
    - 使用斷言
    - 複習問題
    - 章節摘要
    - 程式設計練習

    6. 物件導向程式設計
    - 單一實作繼承
    - 物件導向程式設計概念
    - 複習問題
    - 覆寫和隱藏成員
    - 實例方法覆寫
    - 欄位隱藏
    - 靜態方法隱藏
    - 覆寫與重載
    - 物件參考 super
    - 複習問題
    - 使用 this() 和 super() 鏈接建構子
    - this() 建構子調用
    - super() 建構子調用
    - 複習問題
    - 介面
    - 定義介面