2nd. ed. — Needham (Mass.): Green Tea Press, 2020. — 374 p.
Think Java is an
introduction to computer science and programming intended for readers
with little or no experience. We start with the most basic concepts and are careful to define all terms when they are first used. The book presents each new idea in a logical progression. Larger topics, like control flow statements and object-oriented programming, are divided into smaller examples and introduced over the course of several chapters. This book is
intentionally concise.
Each chapter is 12–14 p. and covers the material for one week of a college course. It is
not meant to be a
comprehensive presentation of Java, but rather, an initial exposure to programming constructs and techniques. We begin with
small problems and basic algorithms and work up to
object-oriented design. In the vocabulary of computer science pedagogy, this book uses the
“objects late” approach.
The Philosophy Behind the BookHere are the guiding principles that make the book the way it is:
One concept at a time: We break down topics that give beginners trouble
into a series of small steps, so that they can exercise each new concept in isolation before continuing.
Balance of Java and concepts: The book
is not primarily about Java; it uses code examples to demonstrate computer science. Most chaptersstart with language features and end with concepts.
Conciseness: An important goal of the book is to be small enough so that students can read and understand the entire text in a one-semester college or AP course.
Emphasis on vocabulary: We try to introduce the minimum number of terms and define them carefully when they are first used. We also organize them in glossaries at the end of each chapter.
Program development: There are many strategies for writing programs, including bottom-up, top-down, and others. We demonstrate multiple program development techniques, allowing readers to choose methods that work best for them.
Multiple learning curves: To write a program, you have to understand the algorithm, know the programming language, and be able to debug errors. We discuss these and other aspects throughout the book and summarize our advice in Appendix D.
This
new edition was written over several years, with feedback from dozens of
instructors and hundreds of students.
The examples in this book were developed and tested using
OpenJDK 11. If you are using a
more recent version, everything should still work. If you are using an
older version, some of the examples
might not.