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 (Retired) Delivering the MVP Refactoring

Miguel Gonzalez Rocha
Miguel Gonzalez Rocha
2,849 Points

HELP!!! i dont know whats wrong with my code on the challenge (Refactoring Methods)

public void addItem(Product item){ System.out.printf("1 %s\n", item.getName()); } i have no idea what im missing

2 Answers

Matthew Polland
Matthew Polland
9,652 Points

You need the exact same format of answer that they use in the other test, so it should be "Adding 1 of %s to the cart.%n"

Yael P.
Yael P.
2,816 Points

OMG, I didn't wrote the word 'of' and I failed, Matthew, thank you so much for your help!!! I've worked on it for like an hour!