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 trial
Richard Souch
420 PointsWhenever I go to compile I get this Error
I'm not certain as to why i keep getting this error any pointers would help.
Thank you.
public class Example {
public static void main(String[] args) {
// Your amazing code goes here...
System.out.println("We are making a new pez dispenser");
pezDispenser dispenser = new pezDispenser("Yoda");
System.out.printf("The dispenser character is %s\n",
dispenser.getCharacterName());
if (dispenser.isEmpty()) {
System.out.printIn("It is currently empty");
}
System.out.printIn("Loading...");
dispenser.load();
if (!dispenser.isEmpty()) {
System.out.printIn("It is no longer empty");
}
symbol: method load()
location: variable dispenser of type pezDispenser
Example.java:14: error: cannot find symbol
if (!dispenser.isEmpty()) {
^
symbol: method isEmpty()
location: variable dispenser of type pezDispenser
Example.java:15: error: cannot find symbol
System.out.printIn("It is no longer empty");
^
symbol: method printIn(String)
location: variable out of type PrintStream
Richard Souch
420 Pointscode has been attached I apologize i'm quite new to this.
:)
Gloria Dwomoh
13,116 PointsI have trouble answering this questions because no 1. What is the challenge question you are having issues with and no 2. can you link it?
Richard Souch
420 PointsThank you both for taking the time to respond to me very much appriciated and haha well it seems i was not looking close enough but eh, if i didnt ask questions I wouldn't of learned from it
Thanks again guys.
Craig Dennis
Treehouse TeacherGreat job using the forum! Exactly what it is here for!
Gloria Dwomoh
13,116 PointsRichard Souch, you are welcome. It's great it is now sorted out.
1 Answer
Craig Dennis
Treehouse TeacherIt is println for print line ( not printIn)
Looks like maybe your PezDispenser code isn't saved or isEmpty isn't written yet?
Gloria Dwomoh
13,116 PointsGloria Dwomoh
13,116 PointsCan you attach your code? That will make it easier for others to help.