The Classic Guide to Advanced Java Programming: Fully Updated for Java 21 Core Java is the leading no-nonsense tutorial and reference for experienced programmers who want to write robust Java code for real-world applications. Now, Core Java, Volume II: Fundamentals, Thirteenth Edition, has been revised to cover the new features and enhancements in the Java 21 long-term support release. As always, all chapters have been completely updated, outdated material has been removed, and the new APIs are covered in detail. This volume focuses on the advanced topics that a programmer needs to know for professional software development and includes authoritative coverage of enterprise programming, networking, databases, security, internationalization, and native methods, as well as complete chapters on the Streams, XML, Date and Time, Scripting, and Compilation APIs. In addition, the chapters on Swing and Graphics cover techniques that are applicable to both client-side user interfaces and server-side generation of graphics and images. Cay S. Horstmann clearly explains sophisticated new features with depth and completeness and demonstrates how to use them to build professional-quality applications. Horstmann's thoroughly tested sample code reflects modern Java style and best practices. The examples are carefully crafted for easy understanding and maximum practical value, so you can rely on them to jump-start your own programs. Master advanced techniques, idioms, and best practices for writing reliable Java code Make the most of enhanced Java I/O APIs, object serialization, and regular expressions Connect to network services, harvest web data with the HTTP/2 client, and serve data with the built-in web server or implement your own server Process code via the Scripting and Compiler APIs Work with the Date and Time API, including recent refinements Leverage the Java security model, user authentication, and the security library's cryptographic functions Preview powerful new APIs fo
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Core Java, Volume II: Advanced Features — Reading Guide
## 【One-Line Pitch】
The definitive advanced Java reference for experienced developers, covering enterprise-grade topics like streams, networking, databases, security, and internationalization with practical, tested code examples updated for Java 21. If you've mastered core Java syntax and want to build professional, production-ready applications, this is your next step.
---
## 【Book Arc】
- **Opening (~0%–12%)**: Establishes the advanced foundation with the Streams API—creating infinite streams, using `Optional` for null-safe operations, and mastering collectors including parallel collection with `groupingByConcurrent`. This section assumes you know basic Java and immediately elevates you to functional-style data processing.
- **Early (~12%–28%)**: Dives deep into I/O systems—text vs. binary formats, character encoding (UTF-8 vs. UTF-16), random-access files, and the modern `java.nio.file` API for file attributes and operations. Also introduces object serialization, including `serialVersionUID` management and versioning strategies for evolving classes.
- **Early–Middle (~28%–36%)**: Covers XML processing comprehensively—DOM parsing, DTD validation with constructs like `ID` and `IDREF`, namespace-aware document creation, and XSL transformations for converting XML to other formats. Includes practical examples like building SVG documents.
- **Middle (~36%–48%)**: Shifts to networking and databases. Explores socket programming with multi-threaded servers, the modern `HttpClient` API with its builder pattern, and JDBC fundamentals—queries, result set manipulation, transactions with savepoints, and connection management.
- **Middle–Late (~48%–56%)**: Addresses internationalization and code processing. Covers locale-aware formatting (dates, numbers, currencies), the `BreakIterator` for text segmentation across languages, the Date and Time API with custom `TemporalAdjuster` implementations, and the Compiler API for in-memory source compilation with diagnostic listeners.
---
## 【Key Takeaways】
- **Streams are the backbone of modern Java data processing** (Opening): Master `Stream.generate` and `Stream.iterate` for infinite sequences, and pair them with `Optional` operations like `map` and `filter` for null-safe pipelines. This functional approach replaces verbose loops and reduces boilerplate.
- **Parallel streams require ordering awareness** (Opening): `groupingByConcurrent` uses shared concurrent maps, meaning value order differs from stream order. Use it only when downstream collectors are order-independent—a subtle but critical performance and correctness distinction.
- **Character encoding is a silent killer in I/O** (Early): The same string "José" encodes differently in UTF-16 (Java's internal format) vs. UTF-8 (internet standard). Understanding `OutputStreamWriter` and `InputStreamReader` bridges this gap and prevents data corruption in real-world applications.
- **Serialization versioning is a contract, not an afterthought** (Early): Declaring `serialVersionUID` explicitly gives you control over backward compatibility. When instance fields change, the object input stream attempts conversion but won't coerce mismatched types—plan your evolution strategy carefully.
- **The modern `HttpClient` replaces the fussy `URLConnection`** (Middle): Use the builder pattern with `HttpClient.newBuilder()` for configuration like redirect following. This cleaner API simplifies HTTP/2 communication and web data harvesting compared to the older, stage-based approach.
- **JDBC transactions need explicit management** (Middle): With autocommit off, you control `commit()` and `rollback()`, and savepoints let you partially undo work. This is essential for maintaining data integrity in multi-step database operations.
- **Internationalization is about structure, not translation** (Middle): The same data formats differently across locales—German reverses decimal and comma separators, dates follow different orders. `BreakIterator` handles grapheme clusters and sentence boundaries, while format strings with placeholders manage word-order changes.
- **The Compiler API enables dynamic code generation** (Late): You can compile source from memory using `SimpleJavaFileObject` subclasses, with `DiagnosticListener` capturing errors with file, line, and column information—powerful for scripting and build tools.
---
## 【Reading Tips】
- **Skim the API reference tables** (throughout): The book includes extensive `java.util.*` and `java.sql.*` method listings. Read these when you need specifics, but don't get bogged down—the narrative examples teach the concepts better.
- **Deep-read the Streams and I/O chapters** (Opening–Early): These are foundational for everything else. Work through the code examples actively—modify them, break them, and observe the behavior. The parallel stream ordering caveat is easy to miss but critical.
- **Treat the XML chapter as reference material** (Early–Middle): Unless you work with XML daily, skim the DTD details and focus on the XSL transformation example, which shows a complete, practical workflow. You can always return when needed.
- **Run the networking and database examples** (Middle): The multi-threaded server example with telnet clients and the JDBC query examples are best learned by execution. Set up a local database and experiment with transactions and savepoints.
- **Pay special attention to the internationalization examples** (Middle–Late): The German date and currency formatting examples are eye-opening. Even if you don't need i18n immediately, understanding locale-aware formatting prevents future bugs.
---
## 【Coverage Limits】
This guide covers the first ~56% of the book based on available excerpts. Later chapters on security, cryptography, native methods, Swing, and graphics are not covered here—consult the book's table of contents for those topics.
---
##
Excerpt 1
ue, so you can rely on them to jump-start your own programs. Master advanced techniques, idioms, and best practices for writing reliable Java code Make the m...
e class with those of the version in the serialized object. Of course, the object input stream considers only the nontransient and nonstatic instance fields....
t of all statements that were issued since the last commit. Savepoint setSavepoint() 1.4 Savepoint setSavepoint(String name) 1.4 set an unnamed or named sa...
dea is that you tell everyone in the world your public key. However, only you hold the private key, and it is important that you safeguard it and don’t relea...
t to the layout. void removeLayoutComponent(Component comp) removes a component from the layout. Dimension preferredLayoutSize(Container cont) returns the pr...
ed in the C header stdarg.h . 1.7. Accessing Array Elements All array types of the Java programming language have corresponding C types, as shown in Table 13...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Core Java, Volume II Advanced Features (Cay S. Horstmann)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Core Java, Volume II Advanced Features (Cay S. Horstmann)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment