aspose file tools*
The moose likes Beginning Java and the fly likes QuizCard class not found. (Head First Java 2nd Ed) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "QuizCard class not found. (Head First Java 2nd Ed)" Watch "QuizCard class not found. (Head First Java 2nd Ed)" New topic
Author

QuizCard class not found. (Head First Java 2nd Ed)

Donald Hume
Greenhorn

Joined: Aug 04, 2008
Posts: 12
I'm pretty sure that my code is the same code from page 450 and 451 of HF's Java 2nd Ed. All the compiling errors I get point to problems using QuizCard Objects -- which makes sense because there is no QuizCard class, and I'm even passing in two variables at one point: question.getText() and answer.getText

Here's the code:



Here are my compiling errors.



I really feel like I'm just missing a class somehow -- but I've looked around and I dont see anything else. (there's the QuizCardPlayer code but that doesn't include a QuizCard class.

Thanks for the help.

Don
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Originally posted by Donald Hume:

I really feel like I'm just missing a class somehow -- but I've looked around and I dont see anything else. (there's the QuizCardPlayer code but that doesn't include a QuizCard class.

Thanks for the help.

Don


You are exactly right, you are missing the QuizCard class. If you go to the book's website and scroll to the bottom, you can download code samples from the book. They call this "ready baked code" in the book. In addition to the code in the book, it includes some of the helper classes that are needed, but not directly presented in the book as they are not relevant to the discussion at hand.

The book explains this somewhere... either the intro or the first time they use the "ready baked code". As I recall, it is easy to miss.
Es Tresidder
Greenhorn

Joined: Aug 11, 2010
Posts: 16
I had the same problem as this guy. I went onto the website, downloaded the QuizCard class and saved it in the same file as my QuizCardBuilder class, then tried again to compile the QuizCardBuilder class. I get the following message:

QuizCardBuilder.java:11: cannot access QuizCard
bad class file: .\QuizCard.class
class file contains wrong class: chap14.QuizCard
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
private ArrayList<QuizCard> cardList;
^

What am I doing wrong?

Thanks for your help.

Es
Es Tresidder
Greenhorn

Joined: Aug 11, 2010
Posts: 16
The arrow points at the Q not the beginning of the sentance, didn't paste right into the browser.

Es
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: QuizCard class not found. (Head First Java 2nd Ed)