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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Petros Yiannikouros](https://secure.gravatar.com/avatar/7a92e23e42a083a615efd24397649dce?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Petros Yiannikouros
462 PointsErrors in Compiling
I have two errors for the following code:
if (!dispenser.isEmpty()) {
System.out.println("Dispenser is full");
And the two errors say:
./PezDispenser.java:17: error: illegal start of expression
if (!isEmpty)) {
^
./PezDispenser.java:17: error: cannot find symbol
if (!isEmpty)) {
^
symbol: variable isEmpty
location: class PezDispenser
2 errors
What mistake am I making when I copied letter for letter what Craig did? What did I miss?
1 Answer
![Burak Icel](https://secure.gravatar.com/avatar/df6ff52916d2cd96017e5106b0489a4d?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Burak Icel
11,762 Pointsin your code it says you wrote if (!isEmpty)) { The reason you are getting an error is because you forgot to add a bracket. if (!isEmpty()) {
Steven Parker
230,688 PointsSteven Parker
230,688 PointsIt looks like these errors are referring to a different line, please post the whole code. Or even better, make a snapshot of your workspace and post the link to it here.