Beyond Karel J Robot

Joseph Bergin

The book is available at and at

This volume expands on what students learned in Karel J Robot and presents them with a complete, modern, course in computing. Table Of Contents

Download the source code for Beyond Karel J Robot

There are a few errors in the book. See the list of known errors.

From the Back cover:

Beyond Karel J Robot trades comprehensive coverage of Java low level detail for an understanding of how a language like Java is used to build real programs. It's organization is not that of a reference work, but an enfolding of interesting and necessary concepts used by real programmers.

Topics include
Thorough Treatment of the Most Important Collections (with simple implementations)
Input/Output Idioms
Design Patterns From the Java Libraries (and useful everywhere)
Testing and Test Driven Development
Machine Language introduced via a simulator/assembler
Introduction to GUI Programming
Arrays and Multi-dimensional Arrays
Program Refactoring and Improvement
Sample Programs that Introduce Important Concepts (AI, Translation, Encoding/Encryption, etc)
Integrated treatment of Composition, Delegation, Inheritance, and Encapsulation
More Recursion, Polymorphism, etc.
A Course-long Project/Case-Study

Software will be provided on the combined CD available from CafePress.


From the Preface:

A number of users have asked for more material in the spirit of Karel J Robot. The original book is intended for
only the beginning weeks of a course, which leaves some the dilemma of what to do for the rest of the term.
This volume is an attempt to discuss some additional ideas as well as some more Java features. The chapter
numbering begins where Karel J Robot leaves off and we will frequently make mention of what was learned
there. However, we begin to leave the robot world here and will discuss many ideas from beyond that world.

The two volumes together should form the basis of a first course in computing using Java. While I have
generally followed the guidelines of the College Board recommendations for the APCS AB advanced placement
course, I have not attempted to be encyclopedic. We will see int, double, char, etc., but no attempt was made to
provide all the rules and caveats of such things. Many books that call themselves text-books seem to me to be,
instead, reference works, with everything gathered together nicely to ease looking up information, rather than
books to learn from. Instead, I have attempted to show, for the most part, how the features of Java are used to
build real programs. This is a book about writing programs, including some quite interesting and difficult
programs. You may struggle with some of this material, but the struggle will take you to a better place. I hope
you agree that it is worth the work you will put in to it.

The Intermezzo sections are just examinations of long programs that use important techniques that the novice
must master. Throuighout we emphasize good Object-Oriented development, but also cover many other things
as well. Chapter 14 is special. It is not intented to be used after the rest, but rather, along the way. It introduces a
term-long project that will build something like the Karel J Robot simulator, though in a non-graphical form. In
technical terms, it produces the model to which views can be added later. The sections of that chapter are keyed
to the other chapters in the book, with many exercises that can be done as the student learns the material of
those earlier chapters.

The appendix offers implementations of some collections classes that are similar to, but simpler than, the
classes in the Java libraries. They are intended for reading and study, though we make use of them in the latter
part of the book, starting with the Secondo Intermezzo.

For those who wish to use this as the basis of an AP course, note that the current case study (Grid World) is not
discussed here. Materials exist elsewhere. The combination of these two volumes and study of Grid World
should form a complete course of study for any novice.


Last updated: April 22, 2015