aspose file tools
The moose likes Beginning Java and the fly likes Stanford - Programming Methodology Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Stanford - Programming Methodology Problem" Watch "Stanford - Programming Methodology Problem" New topic
Author

Stanford - Programming Methodology Problem

Rick Maya
Greenhorn

Joined: Jul 20, 2010
Posts: 3
Hello everyone,

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.*;

Thanks for the help in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Rick Maya
Greenhorn

Joined: Jul 20, 2010
Posts: 3
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?

Thanks a lot for the fast reply.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

We have no way of knowing if it's correct; there's nothing fundamentally incorrect about it if you have the appropriate library/libraries.
Rick Maya
Greenhorn

Joined: Jul 20, 2010
Posts: 3
Alright, that's all I need to know! Thanks for the help.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Stanford - Programming Methodology Problem
 
Similar Threads
Checking for negative numbers in method parameters
The Art & Science of Java Chapter 4 Exercise 5 AverageList.java
Art and Science of Java Chapter 4 Exercise 7
Fibonacci
The Art & Science of Java Chapter 4 Exercise 12 FindLargest.java