Currently used at many colleges, universities, and high schools, this hands-on introduction to computer science is ideal for people with little or no programming experience. The goal of this concise book is not just to teach you Java, but to help you think like a computer scientist. You’ll learn how to program--a useful skill by itself--but you'll also discover how to use programming as a means to an end. Authors Allen Downey and Chris Mayfield start with the most basic concepts and gradually move into topics that are more complex, such as recursion and object-oriented programming. Each brief chapter covers the material for one week of a college course and includes exercises to help you practice what you've learned.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A concise, classroom-tested introduction to programming that uses Java as a vehicle for learning how computer scientists break down problems, design algorithms, and debug systematically. Best for complete beginners, AP Computer Science A students, and self-learners who want a one-semester path from "Hello, World" to objects and recursion.
【Book Arc】
- **Opening (~0%–10%)**: Sets the philosophy—"objects late," one concept at a time, balance of Java syntax and CS concepts—and explains how the book maps to a one-semester or AP course, plus where the appendices (tools, graphics) fit.
- **Early (~10%–30%)**: Grounds you in what programming actually is: the basic instruction types (input, output, math, decisions, repetition), the difference between high-level and low-level languages, interpreters vs. compilers, and the first working program with classes, methods, statements, and comments.
- **Early–Middle (~30%–50%)**: Builds fluency with strings, printing, escape sequences, and—crucially—a debugging mindset: experiment deliberately, make mistakes on purpose, and debug incrementally rather than writing everything then fixing it.
- **Middle (~50%–70%)**: Moves from language features into core CS concepts, with each chapter ending in a vocabulary glossary; the excerpts show this transition but do not cover the specific intermediate topics in detail.
- **Late (~70%–90%)**: Reaches the more complex material the blurb promises—recursion and object-oriented programming—after enough procedural grounding that OO features can be explained in terms of the problems they solve.
- **Ending (~90%–100%)**: Consolidates with appendices on development tools (DrJava, Checkstyle, JUnit) and Java 2D graphics, plus accumulated debugging and program-development advice.
【Key Takeaways】
- **Programming is decomposed problem solving** (Early): Every program, however complex, reduces to a few instruction types—input, output, math, decisions, repetition—so the real skill is breaking big tasks into subtasks small enough for those primitives.
- **Computer science is the study of algorithms, not just Java** (Early): The book deliberately uses Java as a means to an end; sorting and similar problems have multiple solutions with different trade-offs, and analyzing them formally is the point.
- **Debugging is detective work and experimental science** (Early–Middle): Form a hypothesis, modify the program, predict the result, and iterate; this mindset matters more than avoiding errors.
- **Build programs incrementally** (Middle): Start with something that works and make small modifications, debugging as you go, so you always have a working program and can isolate errors—illustrated by Linux's evolution from a tiny experiment.
- **Vocabulary is a learning tool** (Middle): Each chapter ends with a glossary in order of appearance; learning these terms carefully makes later chapters easier to read.
- **"Objects late" is a pedagogical choice** (Opening): OO features are motivated by problems in earlier languages, so the book delays them until readers can appreciate what they solve—while still introducing them as quickly as the one-concept-at-a-time rule allows.
- **The book is scoped for one semester** (Opening): Each brief chapter is roughly one week of a college course, with exercises, making it feasible to read and understand the entire text in a term.
- **Deliberate mistakes accelerate learning** (Middle): Experimenting with broken code—missing quotes, misspelled `println`—teaches you what error messages mean before real bugs appear.
【Reading Tips】
- Read in front of a computer and type out the examples; the excerpts explicitly recommend running code in DrJava's Interactions Pane and then in source files to try variations.
- Deep-read the early chapters on program structure, strings, and debugging—they establish the mental model everything else builds on; skim the setup/conventions material and appendices on first pass.
- Treat each chapter's vocabulary section as required review, not optional; the book intentionally introduces a minimum of terms and reuses them heavily.
- Do the exercises, especially the debugging experiments where you intentionally break working code; this is where the "think like a computer scientist" goal is actually practiced.
- Expect the hard spots later: recursion and object-oriented programming arrive only after procedural foundations, so don't skip ahead—each chapter builds on the previous one.
【Coverage Limits】
The excerpts cover the book's preface, philosophy, early chapters on program structure and debugging, and vocabulary, but do not detail the specific middle, late, or ending chapters on recursion, OO design, or the appendices' contents.
Excerpt 1
m/catalog/errata.csp?isbn=9781491929568 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Think Java , the cover image...
s about this book, send email to bookquestions@oreilly.com . For more information about our books, courses, conferences, and news, see our website at http://...
rpreter. Figure 1-1. How interpreted languages are executed. In contrast, a compiler reads the entire program and translates it completely before the program...
between printing AAAA and BBBB. This later evolved to Linux.” Finally, programming sometimes brings out strong emotions. If you are struggling with a difficu...
you should use names that indicate what the variables mean. For example, if you saw these declarations, you could probably guess what values would be stored:...
e 0 . Converted to double , the value assigned to y is 0.0 . One way to solve this problem (once you figure out the bug) is to make the right-hand side a flo...
file while still parsing, that means something was omitted. But the compiler doesn’t know what. It also doesn’t know where. The compiler discovers the error...
dard American format, for example: Thursday, July 16, 2015 . Modify the program so it also displays the date in European format. The final output should be:...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Think Java (Allen B. Downey and Chris Mayfield)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Think Java (Allen B. Downey and Chris Mayfield)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment