Students can purchase both textbooks from the Stanford University Bookstore, which is our recommended place to purchase them. The Art & Science of Java book can also be ordered online from various retailers. An online version of Karel the Robot Learns Java is also linked to above.
Assigned readings will be from these textbooks, which were written by a Stanford CS professor and targeted directly for this course. They also contain references for all topics covered in the class, as well as practice problems. Moreover, our exams are open-book but closed-electronic-device, so it will be advantageous to own physical copies of these textbooks.
However, our homework assignments don't come from the book, and the provided lecture slides generally cover the necessary material. So it is possible to achieve success in this course without owning the textbook. However, we recommend that each student either owns a copy or has convenient access to a copy. At least one copy of this textbook has been made available for checkout from the Stanford Library reserves (search for 106A).