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 trialPeter LABORDE
2,124 PointsJava Objects Challenge - Signature Method. I am making an error and cannot see the error: where can I get help?
I am stuck on Java Objects Challenge Task for signature method:
public String addItem(Product item) {
return addItem(Product item, 1);
}
I have tried numerous variations but get compile errors
1 Answer
Craig Dennis
Treehouse TeacherHmmm...you seem to be passing the type Product
when you are calling the method. Try it without that.
MUZ141044 Wellington Tsmasuo
1,274 PointsMUZ141044 Wellington Tsmasuo
1,274 Pointscheck the addItem() methods. One of them takes one parameter and the other takes two parameters. The one you are trying to call inside addItem(Product item) should take two parameters "item" and "one". It should look like return addItem(item, 1); ... In your example you are declaring the variable Product instead of just passing it to the method.