Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialYeeka Yau
7,410 PointsCannot Find Symbol Error
Hi, I am getting this error in Java-repl, but can't figure out what I am doing wrong. File loads fine, and then I create a new object exactly as Craig does:
Game game = new Game("treehouse");
But then I get:
ERROR: cannot find symbol
symbol: class Game
location: interface Evaluation
Game method$5u30wekcq29apdzhsix8();
Can't figure out why the error is being thrown.
Here is the class code:
public class Game{
private String mAnswer;
private String mHits;
private String mMisses;
// Constructor to make a new Game object
public Game(String answer){
mAnswer = answer;
mHits = "";
mMisses = "";
}
}
Any help would be greatly appreciated!
4 Answers
Craig Dennis
Treehouse TeacherDid you do this beforehand?
:load Game.java
Yeeka Yau
7,410 PointsI still got the error, but the whole thing worked ok from the command line when I compiled and ran Hangman.java, so I have moved on. Thanks.
Craig Dennis
Treehouse TeacherWeird can you try to do a
javac Game.java
at the console. See if there is an error.
Yeeka Yau
7,410 PointsThat works.
Craig Dennis
Treehouse TeacherWeird. Did you get past this?
Andrew Brotherton
7,515 PointsI'm getting the same error, did you find out what may be causing it?
Yeeka Yau
7,410 PointsYeeka Yau
7,410 PointsHi Craig, thanks for your help! Yep definitely did that and it loaded fine. I also just compiled and ran Hangman.java via the console, and it worked fine. But through Java-repl, just loading Game.java - I seemed to get this error...strange. Really enjoying your course by the way!