Leanpub Header

Skip to main content

Modern Java Programming

From First Program to Production-Ready Systems with Java 26

Modern Java Programming
This book is 100% completeLast updated on 2026-10-04

Ready to learn Java without getting lost in theory? Start with your first program, then work your way up to virtual threads, testing, observability and container deployment. With Java 26 and complete code that actually compiles, you’ll build the skills to create software fit for production.

Minimum price

$25.00

$39.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
405
Pages
About

About

About the Book

This book takes you from zero Java knowledge to advanced, production-ready proficiency using the latest Java release. You will install a complete development environment, master the language from syntax to virtual threads, build real applications with testing and observability, and learn how to deploy them in containers. Every code example is complete, idiomatic, and compiles exactly as written.

Bundle

Bundles that include this book

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience spanning software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. His work focuses on understanding complex systems, uncovering security weaknesses and developing practical solutions that make technology more secure, reliable and effective.

Through Steve Publications, he collaborates with experienced researchers, engineers and industry experts to create practical, technically rigorous books on various topics not limited to self-improvement, software development, cybersecurity, cloud computing, DevOps, artificial intelligence and enterprise technologies. His mission is to make complex technical subjects accessible through clear explanations, real-world examples and hands-on exercises that help IT professionals, students and technology enthusiasts build valuable, practical skills.

Steve Publications embraces AI as a supporting tool for translation, proofreading and editorial refinement, not as a substitute for original research, technical expertise, or hands-on experience. Some contributors choose to publish under pseudonyms to protect their privacy or maintain professional boundaries.

Behind every book is a commitment to technical accuracy, practical relevance and continuous improvement. Our publications are written, reviewed and maintained by experienced professionals, with support from a private community of more than 420 engineers and researchers. Rather than prioritizing volume or mass-produced AI-generated content, we focus on delivering reliable, useful resources that readers can apply in real-world environments.

We also welcome experienced professionals who want to share their knowledge by writing or reviewing books, particularly in specialized and emerging technology fields. If you have expertise to contribute, we invite you to get in touch and explore opportunities to collaborate.

Our commitment is simple: To deliver books that respect our readers' time, support their professional growth and provide lasting practical value. If a book does not meet your expectations, Leanpub offers a 60-day money-back guarantee.

Contents

Table of Contents

From First Program to Production-Ready Systems with Java 26

Introduction: Why Java Still Matters

  1. The Numbers That Tell the Story
  2. From Applets to Virtual Threads
  3. What This Book Covers (and Doesn’t)
  4. Your First Milestone
  5. Versions Used in This Book

Chapter 1: Setting Up Your Java Development Environment

  1. Choosing Your JDK
  2. Installing JDK 26
  3. Selecting a Build Tool
  4. Installing Maven
  5. Creating Your First Project
  6. Running Your First Program
  7. Understanding the Project Structure
  8. The Master Project for This Book
  9. Summary

Chapter 2: How Java Works - Compilation and Execution

  1. From Source Code to Bytecode
  2. The Java Virtual Machine
  3. Class Files and the Classpath
  4. The Main Method
  5. Write Once, Run Anywhere
  6. Summary

Chapter 3: Language Fundamentals - Syntax, Types and Control Flow

  1. Variables and Primitive Types
  2. Strings and Immutability
  3. Operators and Expressions
  4. Control Flow Statements
  5. Arrays and Iteration
  6. Methods
  7. Summary

Chapter 4: Object-Oriented Programming in Java

  1. Classes and Objects
  2. Constructors and Initialization
  3. Encapsulation and Access Control
  4. Inheritance and Polymorphism
  5. Interfaces and Abstraction
  6. Abstract Classes vs. Interfaces
  7. Building the Library Management System Domain Model
  8. Summary

Chapter 5: Designing with Objects

  1. Cohesion and Coupling
  2. SOLID Principles in Java
  3. Composition Over Inheritance
  4. Immutability Patterns
  5. The Builder Pattern
  6. Common Design Mistakes
  7. Summary

Chapter 6: Packages, Modules and Project Organization

  1. Package Declaration and Naming
  2. Import Statements
  3. The Java Platform Module System
  4. Organizing a Maven Project
  5. Summary

Chapter 7: Exceptions and Error Handling

  1. Checked vs. Unchecked Exceptions
  2. Try-Catch-Finally Blocks
  3. Try-With-Resources
  4. Creating Custom Exceptions
  5. Exception Handling Best Practices
  6. Logging Errors Properly
  7. Summary

Chapter 8: Generics and Type Safety

  1. Why Generics Exist
  2. Generic Classes and Methods
  3. Type Parameters and Bounds
  4. Wildcards and the PECS Principle
  5. Type Erasure
  6. Common Generic Patterns
  7. Summary

Chapter 9: The Collections Framework

  1. Collection Interfaces Overview
  2. Lists in Practice
  3. Sets and Hashing
  4. Maps and Key-Value Storage
  5. Queues and Deques
  6. Collection Algorithms
  7. Summary

Chapter 10: Functional Programming with Lambdas and Streams

  1. Lambda Expressions
  2. Functional Interfaces
  3. Method References
  4. The Stream API
  5. Common Stream Patterns
  6. Performance Considerations
  7. Summary

Chapter 11: Modern Java Features - Records, Sealed Classes, Pattern Matching

  1. Record Classes
  2. Sealed Classes
  3. Pattern Matching for instanceof
  4. Switch Expressions and Pattern Matching
  5. Record Patterns
  6. Primitive Types in Patterns (Preview, Java 23+)
  7. Lazy Constants (Preview, Java 26)
  8. Text Blocks
  9. Version Compatibility
  10. Summary

Chapter 12: Annotations and Reflection

  1. Built-in Annotations
  2. Defining Custom Annotations
  3. Processing Annotations at Runtime
  4. Reflection Basics
  5. When to Use (and Avoid) Reflection
  6. Annotation Processors
  7. Summary

Chapter 13: Date, Time and Locale

  1. The Legacy Problem
  2. Core Classes
  3. Durations and Periods
  4. Time Zones
  5. Formatting and Parsing
  6. Common Pitfalls
  7. Summary

Chapter 14: File I/O, Networking and HTTP

  1. The NIO.2 File API
  2. Reading and Writing Streams
  3. JSON Processing
  4. HTTP Client
  5. Building a Simple HTTP Service
  6. Resource Management
  7. Summary

Chapter 15: Database Access

  1. JDBC Fundamentals
  2. Connection Pooling
  3. Parameterized Queries
  4. Transaction Management
  5. Introduction to JPA/Hibernate
  6. Entity Relationships and the N+1 Problem
  7. Testing Database Code
  8. Summary

Chapter 16: Concurrency Fundamentals

  1. Threads and Tasks
  2. Shared State and Race Conditions
  3. Synchronization
  4. Atomic Variables
  5. Thread Pools
  6. Concurrent Collections
  7. CompletableFuture: Composable Asynchronous Programming
  8. Summary

Chapter 17: Virtual Threads and Structured Concurrency

  1. The Platform Thread Problem
  2. Virtual Threads Explained
  3. Creating Virtual Threads
  4. When to Use Virtual Threads
  5. Thread Pinning
  6. Scoped Values
  7. Structured Concurrency
  8. Migration Strategies
  9. Applying Virtual Threads to the Library Management System
  10. Summary

Chapter 18: JVM Internals and Memory Management

  1. JVM Architecture Overview
  2. Class Loading: How the JVM Finds and Loads Classes
  3. Heap and Stack Memory
  4. Garbage Collection Fundamentals
  5. Tuning the JVM
  6. Memory Leaks in Java
  7. JVM Troubleshooting Guide
  8. Summary

Chapter 19: Testing Java Applications

  1. Test Types
  2. JUnit 5
  3. Mocking with Mockito
  4. Integration Testing with Testcontainers
  5. Property-Based Testing with jqwik
  6. Testing the Library Management System
  7. Test Coverage
  8. Summary

Chapter 20: Logging, Metrics and Observability

  1. Structured Logging
  2. Metrics Collection
  3. Distributed Tracing with OpenTelemetry
  4. Health Checks
  5. Alerting Strategies
  6. Integrating Observability into the Library Management System
  7. Summary

Chapter 21: Security in Java Applications

  1. Common Vulnerabilities: OWASP Top 10
  2. Input Validation
  3. Authentication and Authorization Basics
  4. Secure Configuration and Secret Management
  5. Cryptography APIs
  6. Summary

Chapter 22: Packaging, Deployment and Containerization

  1. Building JARs and Uber-JARs
  2. Native Images with GraalVM
  3. Dockerizing Java Applications
  4. JVM in Containers
  5. Deployment Patterns
  6. CI/CD Pipeline Example
  7. Summary

Chapter 23: Interoperability and Legacy Integration

  1. Calling Legacy Java Code
  2. Migrating from Older Java Versions
  3. Java and Other Languages
  4. XML Processing
  5. Serialization
  6. Maintaining Backward Compatibility
  7. Summary

Chapter 24: Production Readiness Checklist

  1. Code Quality Standards
  2. Performance Baselines
  3. Reliability Patterns
  4. Documentation Practices
  5. The Production Readiness Checklist
  6. Continuous Improvement
  7. Capstone: The Complete Production-Ready Library Management System
  8. Summary

Conclusion: Your Next Steps

  1. What You Have Built
  2. Where Java Is Heading
  3. Learning Resources

Glossary

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub