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

Java Java Objects Harnessing the Power of Objects Filling the Dispenser

Michel Spaniolo
PLUS
Michel Spaniolo
Courses Plus Student 1,850 Points

im getting errors that say semicolons are missing but theyre there.

getting a compile error that says semicolons are missing,..why https://w.trhou.se/ugu8gwsig1

3 Answers

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 37,329 Points

Hi Michel. You have several errors in your code. I think the one you are stuck on is you are missing the closing quote on this line

PezDispenser dispenser = new PezDispenser("Yoda);

So my best advice is to fix that one and recompile and try to keep fixing errors until there are none. Watch spelling of variables (java is case sensitive) . So

swapHead();

is not equal to

swaphead();

and my last clue is make sure you declare all variables such as pezCount. Keep at it and post back to the Community if you still can't figure out all the errors

Michel Spaniolo
PLUS
Michel Spaniolo
Courses Plus Student 1,850 Points

thanks..yeah i try to figure out what the error is saying and sometime it seems like it something thats not referenced..Thankyou for taking your time.

Michel Spaniolo
PLUS
Michel Spaniolo
Courses Plus Student 1,850 Points

okay my apologies i think i reposted this before fixing "yoda" and swapHead but i cant figure out where the max_pez variable is declared..ill rewatch the video

Mark Sebeck
Mark Sebeck
Treehouse Moderator 37,329 Points

I declared it at the top under

private String characterName;