Book description
The definitive guide to Java programming—thoroughly revised for Java SE 21
Fully updated for the current version of Java, Java SE 21, this comprehensive guide shows, step by step, how to design, write, debug, run, and administer high-performance Java programs. Inside, bestselling author Herbert Schildt and programming expert Dr. Danny Coward cover the entire Java language, including its syntax, keywords, and libraries. The book lays out cutting-edge development techniques and best practices.
Java: The Complete Reference, Thirteenth Edition features clear explanations, detailed code samples, and real-world examples that demonstrate how Java can be put to work in the real world. JavaBeans, servlets, applets, Swing, lambda expressions, multithreading, and the default interface method are thoroughly discussed. You will get full details on all of the latest features and changes in JDK 18 through long-term support (LTS) release JDK 21.
- Designed for novice, intermediate, and professional programmers alike
- Source code for all examples and projects are available for download
- Written in the clear, uncompromising style Herb Schildt is famous for
Table of contents
- Cover
- Title Page
- Copyright Page
- Contents at a Glance
- Contents
- Foreword
- Preface
-
Part I The Java Language
- Chapter 1 The History and Evolution of Java
- Chapter 2 An Overview of Java
- Chapter 3 Data Types, Variables, and Arrays
- Chapter 4 Operators
- Chapter 5 Control Statements
- Chapter 6 Introducing Classes
-
Chapter 7 A Closer Look at Methods and Classes
- Overloading Methods
- Using Objects as Parameters
- A Closer Look at Argument Passing
- Returning Objects
- Recursion
- Introducing Access Control
- Understanding static
- Introducing final
- Arrays Revisited
- Introducing Nested and Inner Classes
- Exploring the String Class
- Using Command-Line Arguments
- Varargs: Variable-Length Arguments
- Local Variable Type Inference with Reference Types
- Chapter 8 Inheritance
- Chapter 9 Packages and Interfaces
- Chapter 10 Exception Handling
-
Chapter 11 Multithreaded Programming
- The Java Thread Model
- The Main Thread
- Creating a Thread
- Creating Multiple Threads
- Using isAlive( ) and join( )
- Thread Priorities
- Synchronization
- Interthread Communication
- Suspending, Resuming, and Stopping Threads
- Obtaining a Thread’s State
- Using a Factory Method to Create and Start a Thread
- Virtual Threads
- Using Multithreading
- Chapter 12 Enumerations, Autoboxing, and Annotations
-
Chapter 13 I/O, Try-with-Resources, and Other Topics
- I/O Basics
- Reading Console Input
- Writing Console Output
- The PrintWriter Class
- Reading and Writing Files
- Automatically Closing a File
- The transient and volatile Modifiers
- Introducing instanceof
- strictfp
- Native Methods
- Using assert
- Static Import
- Invoking Overloaded Constructors Through this( )
- A Word About Value-Based Classes
-
Chapter 14 Generics
- What Are Generics?
- A Simple Generics Example
- A Generic Class with Two Type Parameters
- The General Form of a Generic Class
- Bounded Types
- Using Wildcard Arguments
- Creating a Generic Method
- Generic Interfaces
- Raw Types and Legacy Code
- Generic Class Hierarchies
- Type Inference with Generics
- Local Variable Type Inference and Generics
- Erasure
- Ambiguity Errors
- Some Generic Restrictions
- Chapter 15 Lambda Expressions
-
Chapter 16 Modules
- Module Basics
- java.base and the Platform Modules
- Legacy Code and the Unnamed Module
- Exporting to a Specific Module
- Using requires transitive
- Use Services
- Module Graphs
- Three Specialized Module Features
- Introducing jlink and Module JAR Files
- A Brief Word About Layers and Automatic Modules
- Final Thoughts on Modules
- Chapter 17 Switch Expressions, Records, and Other Recently Added Features
-
Part II The Java Library
- Chapter 18 String Handling
-
Chapter 19 Exploring java.lang
- Primitive Type Wrappers
- Void
- Process
- Runtime
- Runtime.Version
- ProcessBuilder
- System
- System.Logger and System.LoggerFinder
- Object
- Using clone( ) and the Cloneable Interface
- Class
- ClassLoader
- Math
- StrictMath
- Compiler
- Thread, ThreadGroup, and Runnable
- ThreadLocal and InheritableThreadLocal
- Package
- Module
- ModuleLayer
- RuntimePermission
- Throwable
- SecurityManager
- StackTraceElement
- StackWalker and StackWalker.StackFrame
- Enum
- Record
- ClassValue
- The CharSequence Interface
- The Comparable Interface
- The Appendable Interface
- The Iterable Interface
- The Readable Interface
- The AutoCloseable Interface
- The Thread.UncaughtExceptionHandler Interface
- The java.lang Subpackages
-
Chapter 20 java.util Part 1: The Collections Framework
- Collections Overview
- The Collection Interfaces
- The Collection Classes
- Accessing a Collection via an Iterator
- Spliterators
- Storing User-Defined Classes in Collections
- The RandomAccess Interface
- Working with Maps
- Comparators
- The Collection Algorithms
- Arrays
- The Legacy Classes and Interfaces
- Parting Thoughts on Collections
-
Chapter 21 java.util Part 2: More Utility Classes
- StringTokenizer
- BitSet
- Optional, OptionalDouble, OptionalInt, and OptionalLong
- Date
- Calendar
- GregorianCalendar
- TimeZone
- SimpleTimeZone
- Locale
- Random
- Timer and TimerTask
- Currency
-
Formatter
- The Formatter Constructors
- The Formatter Methods
- Formatting Basics
- Formatting Strings and Characters
- Formatting Numbers
- Formatting Time and Date
- The %n and %% Specifiers
- Specifying a Minimum Field Width
- Specifying Precision
- Using the Format Flags
- Justifying Output
- The Space, +, 0, and ( Flags
- The Comma Flag
- The # Flag
- The Uppercase Option
- Using an Argument Index
- Closing a Formatter
- The Java printf( ) Connection
- Scanner
- The ResourceBundle, ListResourceBundle, and PropertyResourceBundle Classes
- Miscellaneous Utility Classes and Interfaces
- The java.util Subpackages
- Chapter 22 Input/Output: Exploring java.io
- Chapter 23 Exploring NIO
- Chapter 24 Networking
-
Chapter 25 Event Handling
- Two Event Handling Mechanisms
- The Delegation Event Model
- Event Classes
- The KeyEvent Class
- Sources of Events
-
Event Listener Interfaces
- The ActionListener Interface
- The AdjustmentListener Interface
- The ComponentListener Interface
- The ContainerListener Interface
- The FocusListener Interface
- The ItemListener Interface
- The KeyListener Interface
- The MouseListener Interface
- The MouseMotionListener Interface
- The MouseWheelListener Interface
- The TextListener Interface
- The WindowFocusListener Interface
- The WindowListener Interface
- Using the Delegation Event Model
- Adapter Classes
- Inner Classes
- Chapter 26 Introducing the AWT: Working with Windows, Graphics, and Text
- Chapter 27 Using AWT Controls, Layout Managers, and Menus
- Chapter 28 Images
-
Chapter 29 The Concurrency Utilities
- The Concurrent API Packages
- Using Synchronization Objects
- Using an Executor
- The TimeUnit Enumeration
- The Concurrent Collections
- Locks
- Atomic Operations
-
Parallel Programming via the Fork/Join Framework
- The Main Fork/Join Classes
- The Divide-and-Conquer Strategy
- A Simple First Fork/Join Example
- Understanding the Impact of the Level of Parallelism
- An Example that Uses RecursiveTask<V>
- Executing a Task Asynchronously
- Cancelling a Task
- Determining a Task’s Completion Status
- Restarting a Task
- Things to Explore
- Some Fork/Join Tips
- The Concurrency Utilities Versus Java’s Traditional Approach
- Chapter 30 The Stream API
- Chapter 31 Regular Expressions and Other Packages
-
Part III Introducing GUI Programming with Swing
- Chapter 32 Introducing Swing
- Chapter 33 Exploring Swing
-
Chapter 34 Introducing Swing Menus
- Menu Basics
- An Overview of JMenuBar, JMenu, and JMenuItem
- Create a Main Menu
- Add Mnemonics and Accelerators to Menu Items
- Add Images and Tooltips to Menu Items
- Use JRadioButtonMenuItem and JCheckBoxMenuItem
- Create a Popup Menu
- Create a Toolbar
- Use Actions
- Put the Entire MenuDemo Program Together
- Continuing Your Exploration of Swing
-
Part IV Applying Java
- Chapter 35 Java Beans
- Chapter 36 Introducing Servlets
- Part V Appendixes
- Index
Product information
- Title: Java: The Complete Reference, Thirteenth Edition, 13th Edition
- Author(s):
- Release date: January 2024
- Publisher(s): McGraw-Hill
- ISBN: 9781265062705
You might also like
book
Head First Java, 3rd Edition
What will you learn from this book? Head First Java is a complete learning experience in …
book
Java: The Complete Reference, Twelfth Edition, 12th Edition
The Definitive Java Programming Guide Fully updated for Java SE 17, Java™: The Complete Reference, Twelfth …
book
Java in a Nutshell, 7th Edition
This updated edition of Java in a Nutshell not only helps experienced Java programmers get the …
book
Effective Java, 3rd Edition
Since this Jolt-award winning classic was last updated in 2008, the Java programming environment has changed …