O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Core Java Volume I—Fundamentals, Eleventh Edition

Book Description

The #1 Java Guide for Serious Programmers: Fully Updated for Java SE 9, 10 & 11

 

For serious programmers, Core Java, Volume I—Fundamentals, Eleventh Edition, is the definitive guide to writing robust, maintainable code. Whether you're using Java SE 9, 10, or 11, it will help you achieve a deep and practical understanding of the language and API, and its hundreds of realistic examples reveal the most powerful and effective ways to get the job done.

 

Cay Horstmann's updated examples reflect Java's long-awaited modularization, showing how to write code that's easier to manage and evolve. You'll learn how to use JShell's new Read-Eval-Print Loop (REPL) for more rapid and exploratory development, and apply key improvements to the Process API, contended locking, logging, and compilation.

 

In this first of two volumes, Horstmann offers in-depth coverage of fundamental Java and UI programming, including objects, generics, collections, lambda expressions, Swing design, concurrency, and functional programming. If you're an experienced programmer moving to Java SE 9, 10, or 11, there's no better source for expert insight, solutions, and code.

  • Master foundational techniques, idioms, and best practices for writing superior Java code
  • Leverage the power of interfaces, lambda expressions, and inner classes
  • Harden programs through effective exception handling and debugging
  • Write safer, more reusable code with generic programming
  • Improve performance and efficiency with Java's standard collections
  • Build cross-platform GUIs with the Swing toolkit
  • Fully utilize multicore processors with Java's improved concurrency

See Core Java, Volume II—Advanced Features, Eleventh Edition (ISBN-13: 978-0-13-516631-4, coming in 2018), for expert coverage of Java 9, 10, and 11 enterprise features, the module system, annotations, networking, security, and advanced UI programming.

 

Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Contents
  5. Preface
  6. Acknowledgments
  7. Chapter 1: An Introduction to Java
    1. 1.1 Java as a Programming Platform
    2. 1.2 The Java “White Paper” Buzzwords
    3. 1.3 Java Applets and the Internet
    4. 1.4 A Short History of Java
    5. 1.5 Common Misconceptions about Java
  8. Chapter 2: The Java Programming Environment
    1. 2.1 Installing the Java Development Kit
    2. 2.2 Using the Command-Line Tools
    3. 2.3 Using an Integrated Development Environment
    4. 2.4 JShell
  9. Chapter 3: Fundamental Programming Structures in Java
    1. 3.1 A Simple Java Program
    2. 3.2 Comments
    3. 3.3 Data Types
    4. 3.4 Variables and Constants
    5. 3.5 Operators
    6. 3.6 Strings
    7. 3.7 Input and Output
    8. 3.8 Control Flow
    9. 3.9 Big Numbers
    10. 3.10 Arrays
  10. Chapter 4: Objects and Classes
    1. 4.1 Introduction to Object-Oriented Programming
    2. 4.2 Using Predefined Classes
    3. 4.3 Defining Your Own Classes
    4. 4.4 Static Fields and Methods
    5. 4.5 Method Parameters
    6. 4.6 Object Construction
    7. 4.7 Packages
    8. 4.8 JAR Files
    9. 4.9 Documentation Comments
    10. 4.10 Class Design Hints
  11. Chapter 5: Inheritance
    1. 5.1 Classes, Superclasses, and Subclasses
    2. 5.2 Object: The Cosmic Superclass
    3. 5.3 Generic Array Lists
    4. 5.4 Object Wrappers and Autoboxing
    5. 5.5 Methods with a Variable Number of Parameters
    6. 5.6 Enumeration Classes
    7. 5.7 Reflection
    8. 5.8 Design Hints for Inheritance
  12. Chapter 6: Interfaces, Lambda Expressions, and Inner Classes
    1. 6.1 Interfaces
    2. 6.2 Lambda Expressions
    3. 6.3 Inner Classes
    4. 6.4 Service Loaders
    5. 6.5 Proxies
  13. Chapter 7: Exceptions, Assertions, and Logging
    1. 7.1 Dealing with Errors
    2. 7.2 Catching Exceptions
    3. 7.3 Tips for Using Exceptions
    4. 7.4 Using Assertions
    5. 7.5 Logging
    6. 7.6 Debugging Tips
  14. Chapter 8: Generic Programming
    1. 8.1 Why Generic Programming?
    2. 8.2 Defining a Simple Generic Class
    3. 8.3 Generic Methods
    4. 8.4 Bounds for Type Variables
    5. 8.5 Generic Code and the Virtual Machine
    6. 8.6 Restrictions and Limitations
    7. 8.7 Inheritance Rules for Generic Types
    8. 8.8 Wildcard Types
    9. 8.9 Reflection and Generics
  15. Chapter 9: Collections
    1. 9.1 The Java Collections Framework
    2. 9.2 Interfaces in the Collections Framework
    3. 9.3 Concrete Collections
    4. 9.4 Maps
    5. 9.5 Views and Wrappers
    6. 9.6 Algorithms
    7. 9.7 Legacy Collections
  16. Chapter 10: Graphical User Interface Programming
    1. 10.1 A History of Java User Interface Toolkits
    2. 10.2 Displaying Frames
    3. 10.3 Displaying Information in a Component
    4. 10.4 Event Handling
    5. 10.5 The Preferences API
  17. Chapter 11: User Interface Components with Swing
    1. 11.1 Swing and the Model-View-Controller Design Pattern
    2. 11.2 Introduction to Layout Management
    3. 11.3 Text Input
    4. 11.4 Choice Components
    5. 11.5 Menus
    6. 11.6 Sophisticated Layout Management
    7. 11.7 Dialog Boxes
  18. Chapter 12: Concurrency
    1. 12.1 What Are Threads?
    2. 12.2 Thread States
    3. 12.3 Thread Properties
    4. 12.4 Synchronization
    5. 12.5 Thread-Safe Collections
    6. 12.6 Tasks and Thread Pools
    7. 12.7 Asynchronous Computations
    8. 12.8 Processes
  19. Appendix
  20. Index
  21. Credits
  22. Bonus Chapter: 13 JavaFX
    1. 13.1 A Brief History of Java GUI Programming
    2. 13.2 Displaying Information in a Scene
    3. 13.3 Event Handling
    4. 13.4 Layout
    5. 13.5 User Interface Controls
    6. 13.6 Properties and Bindings
    7. 13.7 Long-Running Tasks in User Interface Callbacks
  23. Code Snippets