Java 8 Pocket Guide

Book description

When you need quick answers for developing or debugging Java programs, this pocket guide provides a handy reference to standard features of the Java programming language and its platform. You’ll find helpful programming examples, tables, figures, and lists, as well as Java 8 features such as Lambda Expressions and the Date and Time API. It’s an ideal companion, whether you’re in the office, in the lab, or on the road.

Table of contents

  1. Dedication
  2. Preface
    1. Book Structure
    2. Conventions Used in This Book
    3. Safari® Books Online
    4. How to Contact Us
    5. Authors
    6. Acknowledgments
  3. I. Language
    1. 1. Naming Conventions
      1. Class Names
      2. Interface Names
      3. Method Names
      4. Instance and Static Variable Names
      5. Parameter and Local Variable Names
      6. Generic Type Parameter Names
      7. Constant Names
      8. Enumeration Names
      9. Package Names
      10. Annotation Names
      11. Acronyms
    2. 2. Lexical Elements
      1. Unicode and ASCII
        1. Printable ASCII Characters
        2. Nonprintable ASCII Characters
      2. Comments
      3. Keywords
      4. Identifiers
      5. Separators
      6. Operators
      7. Literals
        1. Boolean Literals
        2. Character Literals
        3. Integer Literals
        4. Floating-Point Literals
        5. String Literals
        6. Null Literals
      8. Escape Sequences
      9. Unicode Currency Symbols
    3. 3. Fundamental Types
      1. Primitive Types
      2. Literals for Primitive Types
      3. Floating-Point Entities
        1. Operations Involving Special Entities
      4. Numeric Promotion of Primitive Types
        1. Unary Numeric Promotion
        2. Binary Numeric Promotion
        3. Special Cases for Conditional Operators
      5. Wrapper Classes
      6. Autoboxing and Unboxing
        1. Autoboxing
        2. Unboxing
    4. 4. Reference Types
      1. Comparing Reference Types to Primitive Types
      2. Default Values
        1. Instance and Local Variable Objects
        2. Arrays
      3. Conversion of Reference Types
        1. Widening Conversions
        2. Narrowing Conversions
      4. Converting Between Primitives and Reference Types
      5. Passing Reference Types into Methods
      6. Comparing Reference Types
        1. Using the Equality Operators
        2. Using the equals() Method
        3. Comparing Strings
        4. Comparing Enumerations
      7. Copying Reference Types
        1. Copying a Reference to an Object
        2. Cloning Objects
          1. Shallow and deep cloning
      8. Memory Allocation and Garbage Collection of Reference Types
    5. 5. Object-Oriented Programming
      1. Classes and Objects
        1. Class Syntax
        2. Instantiating a Class (Creating an Object)
        3. Data Members and Methods
        4. Accessing Data Members and Methods in Objects
        5. Overloading
        6. Overriding
        7. Constructors
        8. Superclasses and Subclasses
        9. The this Keyword
      2. Variable-Length Argument Lists
      3. Abstract Classes and Abstract Methods
        1. Abstract Classes
        2. Abstract Methods
      4. Static Data Members, Static Methods, Static Constants, and Static Initializers
        1. Static Data Members
        2. Static Methods
        3. Static Constants
        4. Static Initializers
      5. Interfaces
      6. Enumerations
      7. Annotation Types
        1. Built-in Annotations
        2. Developer-Defined Annotations
      8. Functional Interfaces
    6. 6. Statements and Blocks
      1. Expression Statements
      2. Empty Statement
      3. Blocks
      4. Conditional Statements
        1. The if Statement
        2. The if else Statement
        3. The if else if Statement
        4. The switch Statement
      5. Iteration Statements
        1. The for Loop
        2. The Enhanced for Loop
        3. The while Loop
        4. The do while Loop
      6. Transfer of Control
        1. The break Statement
        2. The continue Statement
        3. The return Statement
      7. Synchronized Statement
      8. Assert Statement
      9. Exception Handling Statements
    7. 7. Exception Handling
      1. The Exception Hierarchy
      2. Checked/Unchecked Exceptions and Errors
        1. Checked Exceptions
        2. Unchecked Exceptions
        3. Errors
      3. Common Checked/Unchecked Exceptions and Errors
        1. Common Checked Exceptions
        2. Common Unchecked Exceptions
        3. Common Errors
      4. Exception Handling Keywords
        1. The throw Keyword
        2. The try/catch/finally Keywords
        3. The try-catch Statement
        4. The try-finally Statement
        5. The try-catch-finally Statement
        6. The try-with-resources Statement
        7. The multi-catch Clause
      5. The Exception Handling Process
      6. Defining Your Own Exception Class
      7. Printing Information About Exceptions
        1. The getMessage() Method
        2. The toString() Method
        3. The printStackTrace() Method
    8. 8. Java Modifiers
      1. Access Modifiers
      2. Other (Nonaccess) Modifiers
  4. II. Platform
    1. 9. Java Platform, Standard Edition
      1. Common Java SE API Libraries
        1. Language and Utility Libraries
        2. Base Libraries
        3. Integration Libraries
        4. Miscellaneous User Interface Libraries
        5. JavaFX User Interface Library
        6. Remote Method Invocation (RMI) and CORBA Libraries
        7. Security Libraries
        8. Extensible Markup Language (XML) Libraries
    2. 10. Development Basics
      1. Java Runtime Environment
      2. Java Development Kit
      3. Java Program Structure
      4. Command-Line Tools
        1. Java Compiler
        2. Java Interpreter
        3. Java Program Packager
        4. JAR File Execution
        5. Java Documenter
      5. Classpath
    3. 11. Memory Management
      1. Garbage Collectors
        1. Serial Collector
        2. Parallel Collector
        3. Parallel Compacting Collector
        4. Concurrent Mark-Sweep Collector
        5. Garbage-First (G1) Collector
      2. Memory Management Tools
      3. Command-Line Options
      4. Resizing the JVM Heap
      5. Metaspace
      6. Interfacing with the GC
        1. Explicit Garbage Collection
        2. Finalization
    4. 12. Basic Input and Output
      1. Standard Streams in, out, and err
      2. Class Hierarchy for Basic Input and Output
      3. File Reading and Writing
        1. Reading Character Data from a File
        2. Reading Binary Data from a File
        3. Writing Character Data to a File
        4. Writing Binary Data to a File
      4. Socket Reading and Writing
        1. Reading Character Data from a Socket
        2. Reading Binary Data from a Socket
        3. Writing Character Data to a Socket
        4. Writing Binary Data to a Socket
      5. Serialization
        1. Serialize
        2. Deserialize
      6. Zipping and Unzipping Files
        1. Compressing and Uncompressing GZIP Files
    5. 13. New I/O API (NIO.2)
      1. The Path Interface
      2. The Files Class
      3. Additional Features
    6. 14. Concurrency
      1. Creating Threads
        1. Extending the Thread Class
        2. Implementing the Runnable Interface
      2. Thread States
      3. Thread Priorities
      4. Common Methods
      5. Synchronization
      6. Concurrent Utilities
        1. Executors
        2. Concurrent Collections
        3. Synchronizers
        4. Timing Utility
    7. 15. Java Collections Framework
      1. The Collection Interface
      2. Implementations
      3. Collection Framework Methods
      4. Collections Class Algorithms
      5. Algorithm Efficiencies
      6. Comparator Functional Interface
    8. 16. Generics Framework
      1. Generic Classes and Interfaces
      2. Constructors with Generics
      3. Substitution Principle
      4. Type Parameters, Wildcards, and Bounds
      5. The Get and Put Principle
      6. Generic Specialization
      7. Generic Methods in Raw Types
    9. 17. The Java Scripting API
      1. Scripting Languages
      2. Script Engine Implementations
        1. Embedding Scripts into Java
        2. Invoking Methods of Scripting Languages
        3. Accessing and Controlling Java Resources from Scripts
      3. Setting Up Scripting Languages and Engines
        1. Scripting Language Setup
        2. Scripting Engine Setup
        3. Scripting Engine Validation
    10. 18. Date and Time API
      1. Legacy Interoperability
      2. Regional Calendars
      3. ISO Calendar
        1. Machine Interface
        2. Durations and Periods
        3. JDBC and XSD Mapping
        4. Formatting
    11. 19. Lambda Expressions
      1. λEs Basics
        1. λEs Syntax and Example
        2. Method and Constructor References
      2. Specific Purpose Functional Interfaces
      3. General Purpose Functional Interfaces
      4. Resources for λEs
        1. Tutorials
        2. Community Resources
  5. III. Appendixes
    1. A. Fluent APIs
    2. B. Third-Party Tools
      1. Development, CM, and Test Tools
      2. Libraries
      3. Integrated Development Environments
      4. Web Application Platforms
      5. Scripting Languages Compatible with JSR-223
    3. C. UML Basics
      1. Class Diagrams
        1. Name
        2. Attributes
        3. Operations
        4. Visibility
      2. Object Diagrams
      3. Graphical Icon Representation
        1. Classes, Abstract Classes, and Interfaces
        2. Notes
        3. Packages
      4. Connectors
      5. Multiplicity Indicators
      6. Role Names
      7. Class Relationships
        1. Association
        2. Direct Association
        3. Composition Association
        4. Aggregation Association
        5. Temporary Association
        6. Generalization
        7. Realization
      8. Sequence Diagrams
        1. Participant (1)
        2. Found Message (2)
        3. Synchronous Message (3)
        4. Return Call (4)
        5. Asynchronous Message (5)
        6. Message to Self (6)
        7. Lifeline (7)
        8. Activation Bar (8)
  6. Index
  7. Copyright

Product information

  • Title: Java 8 Pocket Guide
  • Author(s): Robert Liguori, Patricia Liguori
  • Release date: April 2014
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491900864