The Classic Guide to the Java Programming Language--Fully Updated through Java 21
Whatever version of Java you are using, Core Java, Volume I: Fundamentals, Thirteenth Edition, will help you achieve a deep and practical understanding of the language and APIs. With hundreds of realistic examples, Java Champion Cay S. Horstmann demonstrates the most powerful and effective ways to get the job done.
Written for experienced programmers looking for in-depth coverage of the Java language and platform, this revised and updated edition continues to be the first choice for serious programmers. The carefully crafted sample programs demonstrate almost every language and library feature, as well as the newest capabilities introduced in Java 21. The examples are purposefully simple to focus on the major points, but, for the most part, they aren't fake and they don't cut corners. They should make good starting points for your own code.
This first of two volumes offers a detailed treatment of fundamental Java programming topics, including object-oriented programming, reflection and proxies, interfaces and inner classes, exception handling, generics, collections, lambda expressions, concurrency, annotations, and the Java Platform Module System.
Master foundational techniques, idioms, and best practices for writing superior Java code
Leverage the power of interfaces, lambda expressions, and inner classes
Take advantage of sealed class hierarchies and pattern matching for processing structured data
Harden programs through effective exception handling and debugging
Write safer, more reusable code with generic programming
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
【One-Line Pitch】
A rigorous, example-driven tour of the Java language and core libraries, updated through Java 21, for experienced programmers who want depth rather than a beginner's tutorial. If you already code in another language and need to write serious, idiomatic Java, this is the volume to keep within arm's reach.
【Book Arc】
- **Opening (~0%–12%)**: Orients you in Java's design philosophy and toolchain — the "white paper" buzzwords, the JVM/portability story, and the basic syntax, types, strings, and formatted I/O you need before anything else compiles.
- **Early (~12%–32%)**: Builds the object model: classes, constructors, static members, encapsulation, inheritance, overriding, `equals`/`hashCode`/`toString`, and packaging into JARs, including multi-release JARs.
- **Middle (~32%–52%)**: Moves to abstraction and reuse — interfaces vs. abstract classes, inner and anonymous classes, lambda expressions and method references, reflection and proxies, plus design hints for inheritance.
- **Late (~52%–80%)**: Handles robustness and generality: exception handling and debugging, generic programming, and the collections framework with comparators and adapters.
- **Ending (~80%–100%)**: Covers the more advanced platform topics the blurb lists — concurrency, annotations, and the Java Platform Module System — though the excerpts do not detail these chapters.
【Key Takeaways】
- **Java's value proposition is portability plus safety** (Opening): the buzzwords (architecture-neutral, robust, secure, multithreaded) explain *why* the language is shaped as it is, and Horstmann pairs each claim with a candid reality check — applet-era security failures, the JavaScript confusion, and where the VM genuinely protects you versus C/C++.
- **Formatting and text handling are treated as first-class skills** (Opening): `printf`-style format specifiers, conversion characters, and the subtle trap of Unicode escapes being processed *before* parsing (even inside comments) are the kind of details that separate working code from mysterious syntax errors.
- **Objects need disciplined contracts** (Early–Middle): correct `equals` (identity check, null check, class check, field comparison via `Objects.equals`), a matching `hashCode` via `Objects.hash`, and clear `toString` are presented as non-negotiable habits, not optional polish.
- **Prefer immutability and clear naming** (Early): Horstmann's design hints — meaningful class/method names, `get`/`set` conventions, and immutable classes like `LocalDate` — matter because mutation is exactly what breaks under concurrency.
- **Interfaces and lambdas usually beat reflection** (Middle): `Method.invoke` is powerful but fragile; the book explicitly recommends interfaces and lambda expressions over reflective calls in your own code, and warns against tagging interfaces.
- **Method references and comparators are practical tools** (Middle): the method-reference table, `Comparator.comparing`/`thenComparing`, primitive-specialized variants that avoid boxing, and `nullsFirst`/`nullsLast` adapters show how to write concise, null-safe sorting.
- **Sealed hierarchies enable exhaustive pattern matching** (Middle): declaring subclasses `final` and sealing interfaces lets `instanceof` pattern chains be reasoned about safely — the modern alternative to fragile type-switching.
- **Null is a design decision** (Early): deciding which fields may be null, using the permissive "unknown" fallback, and relying on Java 14+ helpful null-pointer messages are framed as deliberate API design choices.
【Reading Tips】
- **Skim the buzzword chapter, deep-read the code chapters.** The white-paper section is context; the class, interface, and generics chapters are where the durable skill lives.
- **Type the examples rather than reading them.** Horstmann's samples are deliberately simple but realistic, and the API notes (with JDK version numbers) are designed as quick references you'll return to.
- **Treat `equals`/`hashCode`/`clone` and generics as the hard spots.** These are where subtle bugs hide; slow down and verify the contracts.
- **Use the design-hint sections as checklists.** The inheritance hints and immutability advice are short but high-leverage; revisit them when reviewing your own code.
- **Keep the API notes as a lookup layer.** They list only the most commonly used methods, so pair them with the online Javadoc for full coverage.
【Coverage Limits】
The excerpts concentrate on the language fundamentals, object model, interfaces/lambdas, reflection, exceptions, generics, and collections; the later chapters on concurrency, annotations, and the module system are named in the blurb but not detailed in the source material, so this guide treats them only at the level of topic coverage.
Excerpt 1
is organized along the following 11 buzzwords: 1. Simple 2. Object-Oriented 3. Distributed 4. Robust 5. Secure 6. Architecture-Neutral 7. Portable 8. Interpr...
e point in time would be described quite differently in the Chinese or Hebrew lunar calendars, not to mention the calendar used by your customers from Mars....
fied state. The problem with mutation is that it can happen concurrently when multiple threads try to update an object Now the compiler knows the name and pa...
ceof in a type inquiry: if (obj instanceof Cloneable) . . . I recommend that you do not use tagging interfaces in your own programs. Even if the default (sha...
f); Arrays.sort(staff, Comparator.comparing defaultSettings.setProperty("filename", ""); var settings = new Properties(defaultSettings); Yes, you can even sp...
ake the assumption that memory values are only changed when there are explicit instructions in the code. However, a memory value can be changed by another th...
in fine-grained module dependencies can simply require java.se and get all modules of the Java SE platform. Finally, there is an uncommon requires static var...
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 I Fundamentals (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 I Fundamentals (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