Book description
The Definitive Java Programming Guide
Fully updated for Java SE 17, Java™: The Complete Reference, Twelfth Edition explains how to develop, compile, debug, and run Java programs. Best-selling programming author Herb Schildt covers the entire Java language, including its syntax, keywords, and fundamental programming principles. You’ll also find information on key portions of the Java API library, such as I/O, the Collections Framework, the stream library, and the concurrency utilities. Swing, JavaBeans, and servlets are examined, and numerous examples demonstrate Java in action. Of course, recent additions to the Java language, such as records, sealed classes, and switch expressions are discussed in detail. Best of all, the book is written in the clear, crisp, uncompromising style that has made Schildt the choice of millions worldwide.
Coverage includes:
- Data types, variables, arrays, and operators
- Control statements
- Classes, objects, and methods
- Method overloading and overriding
- Inheritance
- Interfaces and packages
- Exception handling
- Multithreaded programming
- Enumerations, autoboxing, and annotations
- The I/O classes
- Generics
- Lambda expressions
- Modules
- Records
- Sealed classes
- Text blocks
- switch expressions
- Pattern matching with instanceof
- String handling
- The Collections Framework
- Networking
- Event handling
- AWT
- Swing
- The Concurrent API
- The Stream API
- Regular expressions
- JavaBeans
- Servlets
- Much, much more
Table of contents
- Cover
- About the Author
- Title Page
- Copyright Page
- Contents at a Glance
- Contents
- Preface
- For Further Study
-
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
- 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, Twelfth Edition, 12th Edition
- Author(s):
- Release date: November 2021
- Publisher(s): McGraw-Hill
- ISBN: 9781260463422
You might also like
book
Java: The Complete Reference, Thirteenth Edition, 13th Edition
The definitive guide to Java programming—thoroughly revised for Java SE 21 Fully updated for the current …
book
Java in a Nutshell, 7th Edition
This updated edition of Java in a Nutshell not only helps experienced Java programmers get the …
book
Learning Java, 6th Edition
Ideal for working programmers new to Java, this best-selling book guides you through the language features …
book
Head First Java, 2nd Edition
Learning a complex new language is no easy task especially when it s an object-oriented computer …