I'm trying to learn Java right now by watching the Stanford course video with Mehran Sahami. I'm using both books advised by them: "Karel learns JAVA" and "The Art and Science of JAVA". The problem is that on the 2nd book (The Art and Science of JAVA) some of the codes do not work.
I'm afraid I might be doing something or maybe the source code is out of date. I don't know if it's even possible for the code to be out of date. So what I wanted to know is if the book is still a "good" resource of if I should find something more recent.
I will post one excerpt from the book for those who don't know the course, so you can evaluate the problem:
According to Eclipse, almost every line in this code has a problem. Starting with "import acm.program.*;
Have you added the proper JAR files to your build path? Without it, Eclipse cannot find the imported package. Therefore it cannot find class ConsoleProgram, which probably has methods println and readInt which can therefore also not be resolved. Add the JAR file and your code should start working.
I just saw on one of the videos that they are using a "special" version of Eclipse with a Stanford tab on the top, perhaps that's why things are not working with me.
They mentioned the "import" subject on one of the lectures but there is no more info about how to load it properly.
I'll try to find more info about that subject. And just to put an end to my doubt: The example code I provided previously is really correct?