Share E-Book

Java (Christian Ullenboom)(Z-Library)

Author Simon Harrer, Jörg Lenhard, Linus Dietz

Java
Language English

Write code that's clean, concise, and to the point: code that others will read with pleasure and reuse. Comparing your code to that of expert programmers is a great way to improve your coding skills. Get hands-on advice to level up your coding style through small and understandable examples that compare flawed code to an improved solution. Discover handy tips and tricks, as well as common bugs an experienced Java programmer needs to know. Make your way from a Java novice to a master craftsman. This book is a useful companion for anyone learning to write clean Java code. The authors introduce you to the fundamentals of becoming a software craftsman, by comparing pieces of problematic code with an improved version, to help you to develop a sense for clean code. This unique before-and-after approach teaches you to create clean Java code. Learn to keep your booleans in check, dodge formatting bugs, get rid of magic numbers, and use the right style of iteration. Write informative comments when needed, but avoid them when they are not. Improve the understandability of your code for others by following conventions and naming your objects accurately. Make your programs more robust with intelligent exception handling and learn to assert that everything works as expected using JUnit5 as your testing framework. Impress your peers with an elegant functional programming style and clear-cut object-oriented class design. Writing excellent code isn't just about implementing the functionality. It's about the small important details that make your code more readable, maintainable, flexible, robust, and faster. Java by Comparison teaches you to spot these details and trains you to become a better programmer. What You Need: You need a Java 8 compiler, a text editor, and a fresh mind.That's it.

Format EPUB
Size 9.9 MB
179
Views
0
Downloads
0.00
Total Donations

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
【One-Line Pitch】 A comprehensive, example-driven Java reference that takes you from language fundamentals (tokens, types, control flow) through advanced topics like generics, lambdas, concurrency, and the Stream API—ideal for self-taught learners or developers who want a single, deep manual rather than a quick tutorial. 【Book Arc】 - **Opening (~0%–9%)**: Introduces the book's purpose and the absolute basics of Java—lexical elements (tokens, identifiers, literals), the structure of classes and statements, primitive data types, variables, operators, and the first branching and looping constructs. This stage solves the "I've never written Java" problem. - **Early (~9%–25%)**: Moves into object orientation: declaring custom classes, visibility (public/private), static members, constants, and enumerations. Then covers inheritance and dynamic binding, plus the core mechanics of the `main` method and command-line arguments. This is where you learn to model real-world problems. - **Early–Middle (~25%–38%)**: Deepens the language with interfaces, sealed classes, records, and a thorough treatment of exceptions (checked vs. unchecked, `try`/`catch`/`finally`, custom exceptions, try-with-resources). Also introduces nested types and the wrapper classes for primitives, including autoboxing. - **Middle (~38%–47%)**: Tackles the harder, more abstract topics: generics (type erasure, wildcards, the PECS principle), lambda expressions, functional interfaces, method/constructor references, and the `java.util.function` package. This is the conceptual peak of the book. - **Late (~44%–47%+)**: Shifts to practical systems programming: the `System` class, JVM memory, locales, the Date-Time API, logging, and a Maven introduction. Then introduces concurrency (threads, executors, `Callable`/`Future`, `CompletableFuture`) and data structures (lists, sets, maps) before ending with the Stream API for declarative, functional-style data processing. 【Key Takeaways】 - **Java syntax is learnable from the ground up** (Opening): The book starts with tokens, Unicode handling, and identifiers, then builds to statements, expressions, and control flow—so even a complete beginner can follow the progression from "hello world" to loops and methods. - **Object orientation is about modeling, not just syntax** (Early): Custom classes, visibility modifiers, and static members are explained with practical motivation (e.g., why passwords should be `private`), giving you a sense of design rather than just keyword definitions. - **Inheritance and dynamic binding are the heart of polymorphism** (Early): The book clarifies how method calls are resolved at runtime, including covariant return types and the limits of dynamic binding for private/static/final methods—critical for writing extensible code. - **Exceptions are a discipline, not an afterthought** (Early–Middle): Checked vs. unchecked exceptions, multi-catch, `finally`, custom exception classes, and try-with-resources are all covered with concrete file-handling examples, teaching you to write robust code that fails gracefully. - **Generics are about compile-time safety, not runtime magic** (Middle): Type erasure, raw types, bounded wildcards, and the PECS principle (Producer Extends, Consumer Super) are explained clearly—this is the chapter that makes generic code readable instead of mysterious. - **Lambdas and functional interfaces change how you structure code** (Middle): The book shows how lambdas implement interfaces, how method references work, and how `Consumer`, `Supplier`, `Predicate`, and `Function` replace boilerplate—enabling a declarative style that's often shorter and clearer. - **Concurrency is about managing threads, not just creating them** (Late): From `Runnable` and thread states to executors, `Callable`/`Future`, and `CompletableFuture`, the book emphasizes polite termination (interrupts) and thread pools over raw thread spawning—essential for real-world performance. - **The Stream API is the culmination of functional thinking** (Late): Internal iteration, terminal operations, and parallel streams let you process collections declaratively, reducing loops and conditionals to pipeline-style expressions that are easier to reason about and test. 【Reading Tips】 - **Skim the Opening (~0–9%) if you already know another C-like language**: The token/type/operator chapters are thorough but standard; jump ahead to the object-oriented chapters around 9–16% where Java's specific design choices (e.g., `var`, switch expressions, text blocks) start to matter. - **Deep-read the Generics and Lambda chapters (~38–44%)**: These are the most conceptually dense and the ones most likely to trip up self-taught developers. Work through the PECS examples and the functional interface table slowly—they're the key to writing modern, idiomatic Java. - **Use the exception chapter (~25–28%) as a reference, not a cover-to-cover read**: The patterns (multi-catch, try-with-resources, custom exceptions) are best absorbed by writing small file-parsing or input-validation programs, not by memorizing the hierarchy. - **Treat the Late chapters (~44–47%) as "pick what you need"**: The concurrency and Stream API sections are practical, but you don't need to master `CompletableFuture` on first read—skim the basics, then return when you have a real async task. - **Watch for starred sections (*)**: These mark advanced or optional topics (e.g., labeled `break`/`continue`, static imports, type tokens). Skip them on a first pass and come back when you encounter a specific need—they're not required for the core narrative. 【Coverage Limits】 This guide covers the book's progression from fundamentals through advanced language features and standard library topics, but the excerpts do not include the book's final chapters on the Stream API's full terminal operations (e.g., `reduce`, `collect`) or any concluding material—so the very end of the book is not summarized here.

Passage locations

Excerpt 1
Notes on Usage Table of Contents Preface 1   Introduction 1.1   Historical Background 1.2   On the Popularity of Java: The Key Features 1.2.1   Bytecode 1.2....
View in text
Excerpt 2
StringBuilder Instances and Strings with StringBuilder 5.6.8   hashCode() with StringBuilder* 5.7   CharSequence as Base Type 5.7.1   Basic Operations of the...
View in text
Excerpt 3
rtions More Detailed 9.10   Conclusion 10   Nested Types 10.1   Nested Classes, Interfaces, and Enumerations 10.2   Static Nested Types 10.2.1   Modifiers an...
View in text
Excerpt 4
the Work* 17.3.9   Priority* 17.4   Enter the Executor 17.4.1   The Executor Interface 17.4.2   Happy as a Group: The Thread Pools 17.4.3   Threads with retu...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List