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


Amulya Arora
Amulya Arora
6,133 Points

what is wrong in this program?

this is the link to my workspace: https://w.trhou.se/le3qqkqk3h

there are 2 files: Example.java , PezDispenser.java

when you complie Example.java it shows 6 errors, so how do I fix them

2 Answers

Carlos Vallejo
Carlos Vallejo
11,821 Points

Hi Amulya

How its going?

You have an error in the method isEmpty, you have the below sentence

if boolean isEmpty() { return pezCount; }

you have to create it as

public boolean isEmpty(){ boolean empty=false; //put the logic here to validate that is empty return empty; }

Amulya Arora
Amulya Arora
6,133 Points

Thanks a lot! Carlos Vallejo