Cover image for Java Pocket Guide

Book description

How many times have you reached an impasse while writing code because you couldn't remember how something in Java worked? This new pocket guide is designed to keep you moving. Concise, convenient and easy to use, the Java Pocket Guide gives you Java stripped down to its bare essentials -- in fact, it's the only book on Java that you can actually fit in your pocket. Written by Robert and Patricia Liguori, senior software and lead information engineers for Java-based air traffic management and simulation environments, Java Pocket Guide contains everything you really need to know about Java, particularly everything you need to remember. The book pays special attention to the new areas in Java 5 and 6, such as generics and annotations. Why do you need the Java Pocket Guide?

  • It's the only CliffsNotes-style guide to Java available

  • Lets you find important things quickly without consulting 1000-page tutorials

  • Includes many command-line options

  • Organized for quick and easy use on the job

If you're looking to learn some aspect of Java, this is not your book. Java Pocket Guide is for the experienced Java programmers among you who need quick reminders to jog your memory on how something in the language works. Simply put, this pocket guide offers practical help for practicing developers.

Table of Contents

  1. Java Pocket Guide
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. Preface
      1. Book Structure
      2. Font Conventions
      3. Comments and Questions
      4. Authors
      5. Safari® Books Online
      6. Acknowledgments
      7. Dedication
    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 Variables Names
        6. Generic Type Parameter Names
        7. Constant Names
        8. Enumeration Names
        9. Package Names
        10. Acronyms
      2. 2. Lexical Elements
        1. Unicode and ASCII
          1. Printable ASCII Characters
          2. Non-Printable 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 ==
            1. Using the equals( ) method
            2. Comparing strings
            3. 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, and Static Constants
          1. Static Data Members
          2. Static Methods
          3. Static Constants
        5. Interfaces
        6. Enumerations
        7. Annotations Types
          1. Built-in Annotations
          2. Developer-Defined Annotations
      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 Block
          4. The catch Block
          5. The finally Block
        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 (Non-Access) Modifiers
    4. II. Platform
      1. 9. Java Platform, SE
        1. Common Java SE API Libraries
          1. Language and Utility Libraries
          2. Base Libraries
          3. Integration Libraries
          4. User Interface Libraries: Miscellaneous
          5. User Interface Libraries: Abstract Window Toolkit (AWT) API
          6. User Interface Libraries: Swing API
          7. Remote Method Invocation (RMI) and CORBA Libraries
          8. Security Libraries
          9. 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. 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. Summary of Class Combinations for File Reading and Writing
          2. Reading Character Data from a File
          3. Reading Binary Data from a File
          4. Writing Character Data to a File
          5. Writing Binary Data to a File
        4. Socket Reading and Writing
          1. Summary of Class Combinations for Reading and Writing to Sockets
          2. Reading Character Data from a Socket
          3. Reading Binary Data from a Socket
          4. Writing Character Data to a Socket
          5. Writing Binary Data to a Socket
        5. Serialization
          1. Serialize
          2. Deserialize
        6. Zipping and Unzipping Files
          1. Compressing and Uncompressing GZIP Files
        7. File and Directory Handling
          1. Commonly Used Methods in Class File
          2. Accessing Existing Files
          3. Seeking in Files
      4. 12. Java Collections Framework
        1. The Collection Interface
        2. Implementations
        3. Collection Framework Methods
        4. Collections Class Algorithms
        5. Algorithm Efficiencies
        6. Comparator Interface
      5. 13. 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
      6. 14. Concurrency
        1. Creating Threads
          1. Extend the Class Thread
          2. Implementing the Interface Runnable
        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. Memory Management
        1. Garbage Collectors
          1. Serial Collector
          2. Parallel Collector
          3. Parallel Compacting Collector
          4. Concurrent Mark-Sweep (CMS) Collector
        2. Memory Management Tools
        3. Command-Line Options
        4. Resizing the JVM Heap
        5. Interfacing with the GC
          1. Explicit Garbage Collection
          2. Finalization
      8. 16. 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
      9. 17. Third-Party Tools
        1. Development Tools
        2. Libraries
        3. IDEs
        4. Web Application Platforms
        5. Scripting Languages
      10. 18. UML Basics
        1. Class Diagrams
          1. Name
          2. Attributes
          3. Operations
            1. 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)
    5. Index
    6. About the Authors
    7. SPECIAL OFFER: Upgrade this ebook with O’Reilly