About the Author xiii
About the Technical Reviewer xv
Acknowledgments xvii
Chapter 1: An Introduction to Java and Its History 1
Chapter 2: Preparing Your Development Environment 37
Chapter 3: Getting Your Feet Wet 75
Chapter 4: Java Syntax 131
Chapter 5: Data Types 225
Chapter 6: Operators 339
Chapter 7: Controlling the Flow 395
Chapter 8: The Stream API 459
Chapter 9: Debugging, Testing, and Documenting 527
Chapter 10: Making Your Application Interactive 631
Chapter 11: Working with Files 713
Chapter 12: The Publish/Subscribe Framework 799
Chapter 13: Garbage Collection 833
Appendix A: Java Modules 879
Appendix B: IntelliJ IDEA Modules 901
Index 903
Write your first code in Java 23 using simple, step-by-step examples that model real-word objects and events, making learning easy. With this book you will be able to pick up core programming concepts without fuss and write efficient Java code in no time. Clear code descriptions and layout ensure you get your code running as soon as possible. Author Iuliana Cosmina focuses on practical knowledge and getting you up to speed quickly—all the bits and pieces a novice needs to get started programming in Java.
In this edition, you will discover how Java has changed since version 17, and how to design and write code using the most recently introduced Java features such as new collection methods, virtual threads, pattern and record matching in switch expressions, structured concurrency tasks, unnamed classes and instance methods, and many more.
This book is a complete Java guide, covering the following topics: setting up a development environment, programming concepts and well-known programming principles, writing Java code following industry-specific design patterns and coding conventions, executing it, debugging, testing, documenting it and even using specialized tools such as IntelliJ IDEA for writing Java code, Maven for building, JUnit Jupiter for testing, and in-memory and Docker-hosted databases or data storage. After reading this book, you’ll have all the necessary skills and knowledge to pass an interview for a starting Java development position.
Those who are new to programming and want to learn Java and use it to build efficient solutions