Introduction
This book is a practical guide for learning to write code, using the Java language. It can be used in an introductory Java class (e.g. AP Computer Science), or as a guidebook for self-study.
I emphasize writing unit tests to validate your own code. Writing tests for your own code will give you confidence that your code does what you expect it to. With the development of generative AI, it is easy to generate code to solve any problem in any programming language, and the code may seem to work. However, it is now even more important for software developers to ensure that code behaves as expected.
Rather than reading this book, I recommend that you focus on writing code, i.e. doing the exercises for each chapter. The only way to learn to write code is to actually write code. Each chapter has working code examples that illustrate new syntax or concepts, together with the output from running the code. You will learn much more by struggling with and completing the exercises than by reading the examples.