This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Head First Java - QuizCardBuilder won't compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Java - QuizCardBuilder won Watch "Head First Java - QuizCardBuilder won New topic
Author

Head First Java - QuizCardBuilder won't compile

Brian Altman
Greenhorn

Joined: Nov 16, 2012
Posts: 5
Hi,

I can't get this to compile. Where are my errors?



Here are the errors I'm receiving:
QuizCardBuilder.java:11: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder
private ArrayList<QuizCard> cardList;
^
QuizCardBuilder.java:45: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder
cardList = new ArrayList<QuizCard>();
^
QuizCardBuilder.java:75: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder.NextCardListener
QuizCard card = new QuizCard(question.getText(), answer.getText());
^
QuizCardBuilder.java:75: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder.NextCardListener
QuizCard card = new QuizCard(question.getText(), answer.getText());
^
QuizCardBuilder.java:84: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder.SaveMenuListener
QuizCard card = new QuizCard(question.getText(), answer.getText());
^
QuizCardBuilder.java:84: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder.SaveMenuListener
QuizCard card = new QuizCard(question.getText(), answer.getText());
^
QuizCardBuilder.java:110: cannot find symbol
symbol : class QuizCard
location: class QuizCardBuilder
for(QuizCard card:cardList) {
^
7 errors

Thanks in advance for any help!
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Based on the messages you get, you're missing classes (QuizCard and QuizCardBuilder for start).

If you have the source code of these classes, then you need to make your class available to see it (either put all of them in the same package or add import statement in your existing class).


The quieter you are, the more you are able to hear.
Brian Altman
Greenhorn

Joined: Nov 16, 2012
Posts: 5
Class QuizCardBuilder is in my code above. I don't see a QuizCard class anywhere in the book.
Brian Altman
Greenhorn

Joined: Nov 16, 2012
Posts: 5
Nevermind, I just read in the book that I'm supposed to make the QuizCard class myself.

Thanks for the reply Kemal!
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Sorry about that, I reviewed post over phone and missed the class name in the code.

If there is a source code for the book available for download (probably there is, as for the most of the books) you might find the class missing there.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Head First Java - QuizCardBuilder won't compile
 
Similar Threads
New Quiz Card Builder/Player for Exam Study
QuizCard class not found. (Head First Java 2nd Ed)
Runtime Error in Program for Unknown Reasons
HeadFirst >>Chapter14:ArrayList Error
NetBeans IDE 7.2 Output Message interpretation