Java™ Language Specification, Third Edition, The

Book description

Written by the inventors of the technology, The Java™ Language Specification, Third Edition, is the definitive technical reference for the Java™ programming language. If you want to know the precise meaning of the language's constructs, this is the source for you.

The book provides complete, accurate, and detailed coverage of the Java programming language. It provides full coverage of all new features added since the previous edition, including generics, annotations, asserts, autoboxing, enums, for-each loops, variable arity methods, and static import clauses.



Table of contents

  1. Copyright
    1. Dedication
  2. Preface
  3. Preface to the Second Edition
  4. Preface to the Third Edition
  5. 1. Introduction
    1. 1.1. Example Programs
    2. 1.2. Notation
    3. 1.3. Relationship to Predefined Classes and Interfaces
    4. 1.4. References
      1. Bibliography
  6. 2. Grammars
    1. 2.1. Context-Free Grammars
    2. 2.2. The Lexical Grammar
    3. 2.3. The Syntactic Grammar
    4. 2.4. Grammar Notation
  7. 3. Lexical Structure
    1. 3.1. Unicode
    2. 3.2. Lexical Translations
    3. 3.3. Unicode Escapes
    4. 3.4. Line Terminators
    5. 3.5. Input Elements and Tokens
    6. 3.6. White Space
    7. 3.7. Comments
    8. 3.8. Identifiers
    9. 3.9. Keywords
    10. 3.10. Literals
      1. 3.10.1. Integer Literals
      2. 3.10.2. Floating-Point Literals
      3. 3.10.3. Boolean Literals
      4. 3.10.4. Character Literals
      5. 3.10.5. String Literals
      6. 3.10.6. Escape Sequences for Character and String Literals
      7. 3.10.7. The Null Literal
    11. 3.11. Separators
    12. 3.12. Operators
  8. 4. Types, Values, and Variables
    1. 4.1. The Kinds of Types and Values
    2. 4.2. Primitive Types and Values
      1. 4.2.1. Integral Types and Values
      2. 4.2.2. Integer Operations
      3. 4.2.3. Floating-Point Types, Formats, and Values
      4. 4.2.4. Floating-Point Operations
      5. 4.2.5. The boolean Type and boolean Values
    3. 4.3. Reference Types and Values
      1. 4.3.1. Objects
      2. 4.3.2. The Class Object
      3. 4.3.3. The Class String
      4. 4.3.4. When Reference Types Are the Same
    4. 4.4. Type Variables
    5. 4.5. Parameterized Types
      1. 4.5.1. Type Arguments and Wildcards
        1. 4.5.1.1. Type Argument Containment and Equivalence
      2. 4.5.2. Members and Constructors of Parameterized Types
    6. 4.6. Type Erasure
    7. 4.7. Reifiable Types
    8. 4.8. Raw Types
    9. 4.9. Intersection Types
    10. 4.10. Subtyping
      1. 4.10.1. Subtyping among Primitive Types
      2. 4.10.2. Subtyping among Class and Interface Types
      3. 4.10.3. Subtyping among Array Types
    11. 4.11. Where Types Are Used
    12. 4.12. Variables
      1. 4.12.1. Variables of Primitive Type
      2. 4.12.2. Variables of Reference Type
        1. 4.12.2.1. Heap Pollution
      3. 4.12.3. Kinds of Variables
      4. 4.12.4. final Variables
      5. 4.12.5. Initial Values of Variables
      6. 4.12.6. Types, Classes, and Interfaces
  9. 5. Conversions and Promotions
    1. 5.1. Kinds of Conversion
      1. 5.1.1. Identity Conversions
      2. 5.1.2. Widening Primitive Conversion
      3. 5.1.3. Narrowing Primitive Conversions
      4. 5.1.4. Widening and Narrowing Primitive Conversions
      5. 5.1.5. Widening Reference Conversions
      6. 5.1.6. Narrowing Reference Conversions
      7. 5.1.7. Boxing Conversion
      8. 5.1.8. Unboxing Conversion
      9. 5.1.9. Unchecked Conversion
      10. 5.1.10. Capture Conversion
      11. 5.1.11. String Conversions
      12. 5.1.12. Forbidden Conversions
      13. 5.1.13. Value Set Conversion
    2. 5.2. Assignment Conversion
    3. 5.3. Method Invocation Conversion
    4. 5.4. String Conversion
    5. 5.5. Casting Conversion
    6. 5.6. Numeric Promotions
      1. 5.6.1. Unary Numeric Promotion
      2. 5.6.2. Binary Numeric Promotion
  10. 6. Names
    1. 6.1. Declarations
    2. 6.2. Names and Identifiers
    3. 6.3. Scope of a Declaration
      1. 6.3.1. Shadowing Declarations
      2. 6.3.2. Obscured Declarations
    4. 6.4. Members and Inheritance
      1. 6.4.1. The Members of Type Variables, Parameterized Types, Raw Types and Intersection Types
      2. 6.4.2. The Members of a Package
      3. 6.4.3. The Members of a Class Type
      4. 6.4.4. The Members of an Interface Type
      5. 6.4.5. The Members of an Array Type
    5. 6.5. Determining the Meaning of a Name
      1. 6.5.1. Syntactic Classification of a Name According to Context
      2. 6.5.2. Reclassification of Contextually Ambiguous Names
      3. 6.5.3. Meaning of Package Names
        1. 6.5.3.1. Simple Package Names
        2. 6.5.3.2. Qualified Package Names
      4. 6.5.4. Meaning of PackageOrTypeNames
        1. 6.5.4.1. Simple PackageOrTypeNames
        2. 6.5.4.2. Qualified PackageOrTypeNames
      5. 6.5.5. Meaning of Type Names
        1. 6.5.5.1. Simple Type Names
        2. 6.5.5.2. Qualified Type Names
      6. 6.5.6. Meaning of Expression Names
        1. 6.5.6.1. Simple Expression Names
        2. 6.5.6.2. Qualified Expression Names
      7. 6.5.7. Meaning of Method Names
        1. 6.5.7.1. Simple Method Names
        2. 6.5.7.2. Qualified Method Names
    6. 6.6. Access Control
      1. 6.6.1. Determining Accessibility
      2. 6.6.2. Details on protected Access
        1. 6.6.2.1. Access to a protected Member
        2. 6.6.2.2. Qualified Access to a protected Constructor
      3. 6.6.3. An Example of Access Control
      4. 6.6.4. Example: Access to public and Non-public Classes
      5. 6.6.5. Example: Default-Access Fields, Methods, and Constructors
      6. 6.6.6. Example: public Fields, Methods, and Constructors
      7. 6.6.7. Example: protected Fields, Methods, and Constructors
      8. 6.6.8. Example: private Fields, Methods, and Constructors
    7. 6.7. Fully Qualified Names and Canonical Names
    8. 6.8. Naming Conventions
      1. 6.8.1. Package Names
      2. 6.8.2. Class and Interface Type Names
      3. 6.8.3. Type Variable Names
      4. 6.8.4. Method Names
      5. 6.8.5. Field Names
      6. 6.8.6. Constant Names
      7. 6.8.7. Local Variable and Parameter Names
  11. 7. Packages
    1. 7.1. Package Members
    2. 7.2. Host Support for Packages
      1. 7.2.1. Storing Packages in a File System
      2. 7.2.2. Storing Packages in a Database
    3. 7.3. Compilation Units
    4. 7.4. Package Declarations
      1. 7.4.1. Named Packages
        1. 7.4.1.1. Package Annotations
      2. 7.4.2. Unnamed Packages
      3. 7.4.3. Observability of a Package
      4. 7.4.4. Scope of a Package Declaration
    5. 7.5. Import Declarations
      1. 7.5.1. Single-Type-Import Declaration
      2. 7.5.2. Type-Import-on-Demand Declaration
      3. 7.5.3. Single Static Import Declaration
      4. 7.5.4. Static-Import-on-Demand Declaration
      5. 7.5.5. Automatic Imports
      6. 7.5.6. A Strange Example
    6. 7.6. Top Level Type Declarations
    7. 7.7. Unique Package Names
  12. 8. Classes
    1. 8.1. Class Declaration
      1. 8.1.1. Class Modifiers
        1. 8.1.1.1. abstract Classes
        2. 8.1.1.2. final Classes
        3. 8.1.1.3. strictfp Classes
      2. 8.1.2. Generic Classes and Type Parameters
      3. 8.1.3. Inner Classes and Enclosing Instances
      4. 8.1.4. Superclasses and Subclasses
      5. 8.1.5. Superinterfaces
      6. 8.1.6. Class Body and Member Declarations
    2. 8.2. Class Members
      1. 8.2.1. Examples of Inheritance
        1. 8.2.1.1. Example: Inheritance with Default Access
        2. 8.2.1.2. Inheritance with public and protected
        3. 8.2.1.3. Inheritance with private
        4. 8.2.1.4. Accessing Members of Inaccessible Classes
    3. 8.3. Field Declarations
      1. 8.3.1. Field Modifiers
        1. 8.3.1.1. static Fields
        2. 8.3.1.2. final Fields
        3. 8.3.1.3. transient Fields
        4. 8.3.1.4. volatile Fields
      2. 8.3.2. Initialization of Fields
        1. 8.3.2.1. Initializers for Class Variables
        2. 8.3.2.2. Initializers for Instance Variables
        3. 8.3.2.3. Restrictions on the use of Fields during Initialization
      3. 8.3.3. Examples of Field Declarations
        1. 8.3.3.1. Example: Hiding of Class Variables
        2. 8.3.3.2. Example: Hiding of Instance Variables
        3. 8.3.3.3. Example: Multiply Inherited Fields
        4. 8.3.3.4. Example: Re-inheritance of Fields
    4. 8.4. Method Declarations
      1. 8.4.1. Formal Parameters
      2. 8.4.2. Method Signature
      3. 8.4.3. Method Modifiers
        1. 8.4.3.1. abstract Methods
        2. 8.4.3.2. static Methods
        3. 8.4.3.3. final Methods
        4. 8.4.3.4. native Methods
        5. 8.4.3.5. strictfp Methods
        6. 8.4.3.6. synchronized Methods
      4. 8.4.4. Generic Methods
      5. 8.4.5. Method Return Type
      6. 8.4.6. Method Throws
      7. 8.4.7. Method Body
      8. 8.4.8. Inheritance, Overriding, and Hiding
        1. 8.4.8.1. Overriding (by Instance Methods)
        2. 8.4.8.2. Hiding (by Class Methods)
        3. 8.4.8.3. Requirements in Overriding and Hiding
        4. 8.4.8.4. Inheriting Methods with Override-Equivalent Signatures
      9. 8.4.9. Overloading
      10. 8.4.10. Examples of Method Declarations
        1. 8.4.10.1. Example: Overriding
        2. 8.4.10.2. Example: Overloading, Overriding, and Hiding
        3. 8.4.10.3. Example: Incorrect Overriding
        4. 8.4.10.4. Example: Overriding versus Hiding
        5. 8.4.10.5. Example: Invocation of Hidden Class Methods
        6. 8.4.10.6. Large Example of Overriding
        7. 8.4.10.7. Example: Incorrect Overriding because of Throws
    5. 8.5. Member Type Declarations
      1. 8.5.1. Modifiers
      2. 8.5.2. Static Member Type Declarations
    6. 8.6. Instance Initializers
    7. 8.7. Static Initializers
    8. 8.8. Constructor Declarations
      1. 8.8.1. Formal Parameters and Formal Type Parameter
      2. 8.8.2. Constructor Signature
      3. 8.8.3. Constructor Modifiers
      4. 8.8.4. Generic Constructors
      5. 8.8.5. Constructor Throws
      6. 8.8.6. The Type of a Constructor
      7. 8.8.7. Constructor Body
        1. 8.8.7.1. Explicit Constructor Invocations
      8. 8.8.8. Constructor Overloading
      9. 8.8.9. Default Constructor
      10. 8.8.10. Preventing Instantiation of a Class
    9. 8.9. Enums
  13. 9. Interfaces
    1. 9.1. Interface Declarations
      1. 9.1.1. Interface Modifiers
        1. 9.1.1.1. abstract Interfaces
        2. 9.1.1.2. strictfp Interfaces
      2. 9.1.2. Generic Interfaces and Type Parameters
      3. 9.1.3. Superinterfaces and Subinterfaces
      4. 9.1.4. Interface Body and Member Declarations
      5. 9.1.5. Access to Interface Member Names
    2. 9.2. Interface Members
    3. 9.3. Field (Constant) Declarations
      1. 9.3.1. Initialization of Fields in Interfaces
      2. 9.3.2. Examples of Field Declarations
        1. 9.3.2.1. Ambiguous Inherited Fields
        2. 9.3.2.2. Multiply Inherited Fields
    4. 9.4. Abstract Method Declarations
      1. 9.4.1. Inheritance and Overriding
      2. 9.4.2. Overloading
      3. 9.4.3. Examples of Abstract Method Declarations
        1. 9.4.3.1. Example: Overriding
        2. 9.4.3.2. Example: Overloading
    5. 9.5. Member Type Declarations
    6. 9.6. Annotation Types
      1. 9.6.1. Predefined Annotation Types
        1. 9.6.1.1. Target
        2. 9.6.1.2. Retention
        3. 9.6.1.3. Inherited
        4. 9.6.1.4. Override
        5. 9.6.1.5. SuppressWarnings
        6. 9.6.1.6. Deprecated
    7. 9.7. Annotations
  14. 10. Arrays
    1. 10.1. Array Types
    2. 10.2. Array Variables
    3. 10.3. Array Creation
    4. 10.4. Array Access
    5. 10.5. Arrays: A Simple Example
    6. 10.6. Array Initializers
    7. 10.7. Array Members
    8. 10.8. Class Objects for Arrays
    9. 10.9. An Array of Characters is Not a String
    10. 10.10. Array Store Exception
  15. 11. Exceptions
    1. 11.1. The Causes of Exceptions
    2. 11.2. Compile-Time Checking of Exceptions
      1. 11.2.1. Exception Analysis of Expressions
      2. 11.2.2. Exception Analysis of Statements
      3. 11.2.3. Exception Checking
      4. 11.2.4. Why Errors are Not Checked
      5. 11.2.5. Why Runtime Exceptions are Not Checked
    3. 11.3. Handling of an Exception
      1. 11.3.1. Exceptions are Precise
      2. 11.3.2. Handling Asynchronous Exceptions
    4. 11.4. An Example of Exceptions
    5. 11.5. The Exception Hierarchy
      1. 11.5.1. Loading and Linkage Errors
      2. 11.5.2. Virtual Machine Errors
  16. 12. Execution
    1. 12.1. Virtual Machine Start-Up
      1. 12.1.1. Load the Class Test
      2. 12.1.2. Link Test: Verify, Prepare, (Optionally) Resolve
      3. 12.1.3. Initialize Test: Execute Initializers
      4. 12.1.4. Invoke Test.main
    2. 12.2. Loading of Classes and Interfaces
      1. 12.2.1. The Loading Process
    3. 12.3. Linking of Classes and Interfaces
      1. 12.3.1. Verification of the Binary Representation
      2. 12.3.2. Preparation of a Class or Interface Type
      3. 12.3.3. Resolution of Symbolic References
    4. 12.4. Initialization of Classes and Interfaces
      1. 12.4.1. When Initialization Occurs
      2. 12.4.2. Detailed Initialization Procedure
      3. 12.4.3. Initialization: Implications for Code Generation
    5. 12.5. Creation of New Class Instances
    6. 12.6. Finalization of Class Instances
      1. 12.6.1. Implementing Finalization
        1. 12.6.1.1. Interaction with the Memory Model
      2. 12.6.2. Finalizer Invocations are Not Ordered
    7. 12.7. Unloading of Classes and Interfaces
    8. 12.8. Program Exit
  17. 13. Binary Compatibility
    1. 13.1. The Form of a Binary
    2. 13.2. What Binary Compatibility Is and Is Not
    3. 13.3. Evolution of Packages
    4. 13.4. Evolution of Classes
      1. 13.4.1. abstract Classes
      2. 13.4.2. final Classes
      3. 13.4.3. public Classes
      4. 13.4.4. Superclasses and Superinterfaces
      5. 13.4.5. Class Formal Type Parameters
      6. 13.4.6. Class Body and Member Declarations
      7. 13.4.7. Access to Members and Constructors
      8. 13.4.8. Field Declarations
      9. 13.4.9. final Fields and Constants
      10. 13.4.10. static Fields
      11. 13.4.11. transient Fields
      12. 13.4.12. Method and Constructor Declarations
      13. 13.4.13. Method and Constructor Formal Type Parameters
      14. 13.4.14. Method and Constructor Parameters
      15. 13.4.15. Method Result Type
      16. 13.4.16. abstract Methods
      17. 13.4.17. final Methods
      18. 13.4.18. native Methods
      19. 13.4.19. static Methods
      20. 13.4.20. synchronized Methods
      21. 13.4.21. Method and Constructor Throws
      22. 13.4.22. Method and Constructor Body
      23. 13.4.23. Method and Constructor Overloading
      24. 13.4.24. Method Overriding
      25. 13.4.25. Static Initializers
      26. 13.4.26. Evolution of Enums
    5. 13.5. Evolution of Interfaces
      1. 13.5.1. public Interfaces
      2. 13.5.2. Superinterfaces
      3. 13.5.3. The Interface Members
      4. 13.5.4. Interface Formal Type Parameters
      5. 13.5.5. Field Declarations
      6. 13.5.6. Abstract Method Declarations
      7. 13.5.7. Evolution of Annotation Types
  18. 14. Blocks and Statements
    1. 14.1. Normal and Abrupt Completion of Statements
    2. 14.2. Blocks
    3. 14.3. Local Class Declarations
    4. 14.4. Local Variable Declaration Statements
      1. 14.4.1. Local Variable Declarators and Types
      2. 14.4.2. Scope of Local Variable Declarations
      3. 14.4.3. Shadowing of Names by Local Variables
      4. 14.4.4. Execution of Local Variable Declarations
    5. 14.5. Statements
    6. 14.6. The Empty Statement
    7. 14.7. Labeled Statements
    8. 14.8. Expression Statements
    9. 14.9. The if Statement
      1. 14.9.1. The if–then Statement
      2. 14.9.2. The if–then–else Statement
    10. 14.10. The assert Statement
    11. 14.11. The switch Statement
    12. 14.12. The while Statement
      1. 14.12.1. Abrupt Completion
    13. 14.13. The do Statement
      1. 14.13.1. Abrupt Completion
      2. 14.13.2. Example of do statement
    14. 14.14. The for Statement
      1. 14.14.1. The basic for Statement
        1. 14.14.1.1. Initialization of for statement
        2. 14.14.1.2. Iteration of for statement
        3. 14.14.1.3. Abrupt Completion of for statement
      2. 14.14.2. The enhanced for statement
    15. 14.15. The break Statement
    16. 14.16. The continue Statement
    17. 14.17. The return Statement
    18. 14.18. The throw Statement
    19. 14.19. The synchronized Statement
    20. 14.20. The try statement
      1. 14.20.1. Execution of try–catch
      2. 14.20.2. Execution of try–catch–finally
    21. 14.21. Unreachable Statements
  19. 15. Expressions
    1. 15.1. Evaluation, Denotation, and Result
    2. 15.2. Variables as Values
    3. 15.3. Type of an Expression
    4. 15.4. FP-strict Expressions
    5. 15.5. Expressions and Run-Time Checks
    6. 15.6. Normal and Abrupt Completion of Evaluation
    7. 15.7. Evaluation Order
      1. 15.7.1. Evaluate Left-Hand Operand First
      2. 15.7.2. Evaluate Operands before Operation
      3. 15.7.3. Evaluation Respects Parentheses and Precedence
      4. 15.7.4. Argument Lists are Evaluated Left-to-Right
      5. 15.7.5. Evaluation Order for Other Expressions
    8. 15.8. Primary Expressions
      1. 15.8.1. Lexical Literals
      2. 15.8.2. Class Literals
      3. 15.8.3. this
      4. 15.8.4. Qualified this
      5. 15.8.5. Parenthesized Expressions
    9. 15.9. Class Instance Creation Expressions
      1. 15.9.1. Determining the Class being Instantiated
      2. 15.9.2. Determining Enclosing Instances
      3. 15.9.3. Choosing the Constructor and its Arguments
      4. 15.9.4. Run-time Evaluation of Class Instance Creation Expressions
      5. 15.9.5. Anonymous Class Declarations
        1. 15.9.5.1. Anonymous Constructors
      6. 15.9.6. Example: Evaluation Order and Out-of-Memory Detection
    10. 15.10. Array Creation Expressions
      1. 15.10.1. Run-time Evaluation of Array Creation Expressions
      2. 15.10.2. Example: Array Creation Evaluation Order
      3. 15.10.3. Example: Array Creation and Out-of-Memory Detection
    11. 15.11. Field Access Expressions
      1. 15.11.1. Field Access Using a Primary
      2. 15.11.2. Accessing Superclass Members using super
    12. 15.12. Method Invocation Expressions
      1. 15.12.1. Compile-Time Step 1: Determine Class or Interface to Search
      2. 15.12.2. Compile-Time Step 2: Determine Method Signature
        1. 15.12.2.1. Identify Potentially Applicable Methods
        2. 15.12.2.2. Phase 1: Identify Matching Arity Methods Applicable by Subtyping
        3. 15.12.2.3. Phase 2: Identify Matching Arity Methods Applicable by Method Invocation Conversion
        4. 15.12.2.4. Phase 3: Identify Applicable Variable Arity Methods
        5. 15.12.2.5. Choosing the Most Specific Method
        6. 15.12.2.6. Method Result and Throws Types
        7. 15.12.2.7. Inferring Type Arguments Based on Actual Arguments
        8. 15.12.2.8. Inferring Unresolved Type Arguments
        9. 15.12.2.9. Examples
        10. 15.12.2.10. Example: Overloading Ambiguity
        11. 15.12.2.11. Example: Return Type Not Considered
        12. 15.12.2.12. Example: Compile-Time Resolution
      3. 15.12.3. Compile-Time Step 3: Is the Chosen Method Appropriate?
      4. 15.12.4. Runtime Evaluation of Method Invocation
        1. 15.12.4.1. Compute Target Reference (If Necessary)
        2. 15.12.4.2. Evaluate Arguments
        3. 15.12.4.3. Check Accessibility of Type and Method
        4. 15.12.4.4. Locate Method to Invoke
        5. 15.12.4.5. Create Frame, Synchronize, Transfer Control
        6. 15.12.4.6. Example: Target Reference and Static Methods
        7. 15.12.4.7. Example: Evaluation Order
        8. 15.12.4.8. Example: Overriding
        9. 15.12.4.9. Example: Method Invocation using super
    13. 15.13. Array Access Expressions
      1. 15.13.1. Runtime Evaluation of Array Access
      2. 15.13.2. Examples: Array Access Evaluation Order
    14. 15.14. Postfix Expressions
      1. 15.14.1. Expression Names
      2. 15.14.2. Postfix Increment Operator ++
      3. 15.14.3. Postfix Decrement Operator --
    15. 15.15. Unary Operators
      1. 15.15.1. Prefix Increment Operator ++
      2. 15.15.2. Prefix Decrement Operator --
      3. 15.15.3. Unary Plus Operator +
      4. 15.15.4. Unary Minus Operator -
      5. 15.15.5. Bitwise Complement Operator ~
      6. 15.15.6. Logical Complement Operator !
    16. 15.16. Cast Expressions
    17. 15.17. Multiplicative Operators
      1. 15.17.1. Multiplication Operator *
      2. 15.17.2. Division Operator /
      3. 15.17.3. Remainder Operator %
    18. 15.18. Additive Operators
      1. 15.18.1. String Concatenation Operator +
        1. 15.18.1.1. String Conversion
        2. 15.18.1.2. Optimization of String Concatenation
        3. 15.18.1.3. Examples of String Concatenation
      2. 15.18.2. Additive Operators (+ and -) for Numeric Types
    19. 15.19. Shift Operators
    20. 15.20. Relational Operators
      1. 15.20.1. Numerical Comparison Operators <, <=, >, and >=
      2. 15.20.2. Type Comparison Operator instanceof
    21. 15.21. Equality Operators
      1. 15.21.1. Numerical Equality Operators == and !=
      2. 15.21.2. Boolean Equality Operators == and !=
      3. 15.21.3. Reference Equality Operators == and !=
    22. 15.22. Bitwise and Logical Operators
      1. 15.22.1. Integer Bitwise Operators &, ^, and |
      2. 15.22.2. Boolean Logical Operators &, ^, and |
    23. 15.23. Conditional-And Operator &&
    24. 15.24. Conditional-Or Operator ||
    25. 15.25. Conditional Operator ? :
    26. 15.26. Assignment Operators
      1. 15.26.1. Simple Assignment Operator =
      2. 15.26.2. Compound Assignment Operators
    27. 15.27. Expression
    28. 15.28. Constant Expression
  20. 16. Definite Assignment
    1. 16.1. Definite Assignment and Expressions
      1. 16.1.1. Boolean Constant Expressions
      2. 16.1.2. The Boolean Operator &&
      3. 16.1.3. The Boolean Operator ||
      4. 16.1.4. The Boolean Operator !
      5. 16.1.5. The Boolean Operator ? :
      6. 16.1.6. The Conditional Operator ? :
      7. 16.1.7. Other Expressions of Type boolean
      8. 16.1.8. Assignment Expressions
      9. 16.1.9. Operators ++ and --
      10. 16.1.10. Other Expressions
    2. 16.2. Definite Assignment and Statements
      1. 16.2.1. Empty Statements
      2. 16.2.2. Blocks
      3. 16.2.3. Local Class Declaration Statements
      4. 16.2.4. Local Variable Declaration Statements
      5. 16.2.5. Labeled Statements
      6. 16.2.6. Expression Statements
      7. 16.2.7. if Statements
      8. 16.2.8. assert Statements
      9. 16.2.9. switch Statements
      10. 16.2.10. while Statements
      11. 16.2.11. do Statements
      12. 16.2.12. for Statements
        1. 16.2.12.1. Initialization Part
        2. 16.2.12.2. Incrementation Part
      13. 16.2.13. break, continue, return, and throw Statements
      14. 16.2.14. synchronized Statements
      15. 16.2.15. try Statements
    3. 16.3. Definite Assignment and Parameters
    4. 16.4. Definite Assignment and Array Initializers
    5. 16.5. Definite Assignment and Enum Constants
    6. 16.6. Definite Assignment and Anonymous Classes
    7. 16.7. Definite Assignment and Member Types
    8. 16.8. Definite Assignment and Static Initializers
    9. 16.9. Definite Assignment, Constructors, and Instance Initializers
  21. 17. Threads and Locks
    1. 17.1. Locks
    2. 17.2. Notation in Examples
    3. 17.3. Incorrectly Synchronized Programs Exhibit Surprising Behaviors
    4. 17.4. Memory Model
      1. 17.4.1. Shared Variables
      2. 17.4.2. Actions
      3. 17.4.3. Programs and Program Order
      4. 17.4.4. Synchronization Order
      5. 17.4.5. Happens-before Order
      6. 17.4.6. Executions
      7. 17.4.7. Well-Formed Executions
      8. 17.4.8. Executions and Causality Requirements
      9. 17.4.9. Observable Behavior and Nonterminating Executions
    5. 17.5. Final Field Semantics
      1. 17.5.1. Semantics of Final Fields
      2. 17.5.2. Reading Final Fields During Construction
      3. 17.5.3. Subsequent Modification of Final Fields
      4. 17.5.4. Write Protected Fields
    6. 17.6. Word Tearing
    7. 17.7. Non-atomic Treatment of double and long
    8. 17.8. Wait Sets and Notification
      1. 17.8.1. Wait
      2. 17.8.2. Notification
      3. 17.8.3. Interruptions
      4. 17.8.4. Interactions of Waits, Notification and Interruption
    9. 17.9. Sleep and Yield
  22. 18. Syntax
    1. 18.1. The Grammar of the Java Programming Language
  23. Credits
  24. Colophon

Product information

  • Title: Java™ Language Specification, Third Edition, The
  • Author(s): James Gosling, Bill Joy, Guy Steele, Gilad Bracha
  • Release date: June 2005
  • Publisher(s): Addison-Wesley Professional
  • ISBN: None