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 Constants

Ranak Bansal
Ranak Bansal
1,207 Points

Pez Dispenser File Will Not Open

Whenever I try to open the Pez Dispenser file it doesn't open and I get the following message: illegal start of statement. Here is my code:

jshell> /open PezDispenser.java
| Error:
| illegal start of statement
| }
| ^

2 Answers

Cam Richardson
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree
Cam Richardson
Front End Web Development Treehouse Moderator 16,895 Points

Can you post the contents of your PezDispender.java file? It appears that you may have a stray closing bracket somewhere that is throwing the compiler into a fit.

Ranak Bansal
Ranak Bansal
1,207 Points

I checked my code and was able to find the extra bracket, thanks for the help!