Core Java, Volume I: Fundamentals, 12th Edition

Book description

The #1 Java Guide for Serious Programmers: Fully Updated through Java 17

Core Java, Volume I: Fundamentals, Twelfth Edition, is the definitive guide to writing robust, maintainable code. Whatever version of Java you are using--up to and including Java 17--this book will help you achieve a deep and practical understanding of the language and APIs. With hundreds of realistic examples, Cay S. Horstmann reveals the most powerful and effective ways to get the job done.

This book is written for readers with prior programming experience who are looking for in-depth coverage of the Java language and platform. You'll learn about all language features in detail, including the recent improvements in Java 17. The applied chapters and code examples cover the most up-to-date capabilities of the vast Java library. For 25 years, Core Java has prepared serious programmers for serious Java programming.

This first of two volumes offers in-depth coverage of fundamental Java programming, including object-oriented programming, generics, collections, lambda expressions, concurrency, and functional programming. Classic material for Swing UI programming is included for those who need it. This edition's new content covers text blocks, switch enhancements, records, pattern matching for instanceof, sealed classes, and more.

  • 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

  • Explore simple programs with JShell and assemble complex programs with archives and modules

  • Build cross-platform GUIs with the Swing toolkit

  • Fully utilize multicore processors with Java's powerful concurrency model

See Core Java, Volume II: Advanced Features, Twelfth Edition (coming in 2022), for expert coverage of Java 17 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. About This eBook
  3. Halftitle Page
  4. Title Page
  5. Copyright Page
  6. Pearson’s Commitment to Diversity, Equity, and Inclusion
  7. Contents
  8. Preface
    1. To the Reader
    2. A Tour of This Book
    3. Conventions
    4. Sample Code
  9. Acknowledgments
  10. 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
  11. 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
  12. 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
  13. 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 Records
    8. 4.8 Packages
    9. 4.9 JAR Files
    10. 4.10 Documentation Comments
    11. 4.11 Class Design Hints
  14. 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 Abstract Classes
    7. 5.7 Enumeration Classes
    8. 5.8 Sealed Classes
    9. 5.9 Reflection
    10. 5.10 Design Hints for Inheritance
  15. 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
  16. 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
  17. 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
  18. 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 Copies and Views
    6. 9.6 Algorithms
    7. 9.7 Legacy Collections
  19. 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
  20. 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
  21. 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
  22. A. Appendix
  23. Index
  24. Code Snippets

Product information

  • Title: Core Java, Volume I: Fundamentals, 12th Edition
  • Author(s): Cay S. Horstmann
  • Release date: December 2021
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780137673810