Using Programming In Context 2nd Edition: What Actually Works
I picked up Programming In Context 2nd Second Edition By Miller Bradley N Ranum David L Published By Jones Bartlett Learning 2013 when I was TA-ing intro CS at a state school around 2015. The book tries to do something most intro texts fail at: teaching programming through actual domain problems instead of abstract exercises that feel meaningless. Java, object-oriented, with examples pulled from things like robotics and business applications. It was written by people who actually built a curriculum around this idea. The structure is straightforward. Each chapter introduces a programming concept, then immediately anchors it in a contextual problem. You learn loops by building something that processes sensor data. You learn inheritance through a robotics example. The approach works better than it has any right to, mostly because students actually care about what they are building.
Getting the Most Out of Programming In Context 2nd Second Edition By Miller Bradley N Ranum David L Published By Jones Bartlett Learning 2013
Here is the practical side. The book ships with a CD or download link for the example code, and I mean that literally — it is not a companion website. The code examples are in the book, and the full project files come separately. If you are reading this on Kindle or a PDF, you may not have the downloadable code. That matters because the book is not written to be understood purely by reading. The exercises build on code you need to see actually running. The exercises are the real component. They range from straightforward fill-in-the-blank to full project assignments. The early ones are fine. The later ones, particularly the robotics projects in the second half, are where most students hit a wall. I have seen this repeatedly. A student will try to modify a working simulation and break three unrelated things at once because the codebase has hidden coupling between the robot class and the sensor input handler. The fix is almost always the same: revert to the last known-good version, then change one thing at a time. The book does not spell this out because it assumes you know how to debug. Which brings me to the first counter-intuitive point. Most people treat this book as a beginner text. It is not really. The earlier chapters are introductory, sure, but the second half assumes you can already read code at a reasonable pace. If you have never written more than a hundred lines of Java in your life, you will struggle with Chapter 8 onward. The book skips over basic syntax quickly and moves into abstraction. You need a foundation. Not mastery, just enough comfort that you are not simultaneously learning syntax and concepts.
Another thing nobody warns you about: the book uses a custom graphics library for the robotics demos. It is not standard Java. It is bundled with the course materials. When you try to compile the examples on your own machine without the library on your classpath, you get errors that make no sense. I spent two hours once trying to figure out why a perfectly valid method call was throwing a NoSuchMethodError. Turns out the library had been refactored between versions and the error messages gave zero indication of what was actually missing. The workaround was downloading the exact library jar that matched your edition — the book lists it in the front matter, but it is easy to miss if you are just flipping through chapters. The best way to use this book is alongside someone who knows Java. A lab partner, a tutor, a friend. Self-study is possible but you will waste significant time on setup issues that have nothing to do with learning the material. The content itself is solid. The OOP chapters are genuinely well-written, especially the section on polymorphism and the robotics hierarchy. That is the part where the contextual approach pays off. You understand polymorphism because you have to make different robot types respond the same way to a command, and the book makes you feel the pain of not having it before you learn it. There are real gaps though. The book covers Java pretty comprehensively but it skips things you will need later. Generics get maybe two pages. Collections are introduced but not explored deeply. If you finish this book and then take a data structures course, you will find yourself relearning a lot of what the book glossed over. The author's note at the end of each chapter sometimes mentions further reading, but the references are sparse. You should pair this with a more reference-heavy text for the topics it rushes through.
Get the Full Details

The exercises don't always have solutions available unless you are an instructor. I ran into this when I was trying to verify my answers independently. The back of the book has answers for some selected problems, but not all. The companion site used to host more, but access has degraded over the years. If you are self-teaching, plan on finding a study group or using a forum like Stack Overflow when you get stuck. The problems are designed to be solvable, but not always straightforwardly. For anyone looking to get a copy, the book is available through Amazon, Barnes & Noble, and directly from Jones & Bartlett Learning. The ISBN for the second edition is 978-0-7637-7597-2. Used copies run about twenty to forty dollars, which is reasonable. The new price is over a hundred. I would recommend the used print copy over the ebook because the layout for code examples is much better, and you will be referencing it constantly. The PDF version compresses the code blocks in a way that makes them hard to read on anything smaller than a tablet. If you are an instructor, the instructor resources are worth requesting. The test bank and slide decks are actually usable, which is rare for textbooks at this level. The slides are rough around the edges but they cover the material accurately and save you hours of preparation time.
One more practical note about the robotics projects. They require a specific version of Java. The book was written when Java 6 was standard, and some of the code will not compile cleanly on Java 11 or later. You may need to run it with an older JDK or deal with deprecated API warnings. It is not a blocker, but it is annoying. I ended up setting up a Java 8 environment specifically for the later chapters, and it saved a lot of frustration. The book is not perfect. It is not comprehensive. It will not teach you everything you need to know to be a professional Java developer. But for an introductory course that wants students to actually understand why they are writing code, it is one of the better options available. The contextual approach works, the exercises are meaningful, and the explanations are clear. Just don't expect it to be a standalone solution. Pair it with practice, pairing it with other resources, and don't skip the setup work. That last part is the one most people ignore and then blame the book for their difficulties.