Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Java - QuizCardBuilder won't compile

 
Brian Altman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Brian Altman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class QuizCardBuilder is in my code above. I don't see a QuizCard class anywhere in the book.
 
Brian Altman
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic