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 Basics Getting Started with Java IO

HOW do l solve Bummer! Did you forget to pass the `lastName` parameter to the printf function?

Have done as the video said but its showing me this message Bummer! Did you forget to pass the lastName parameter to the printf function?

// I have imported java.io.Console for you.  It is a variable called console.
String firstName = console.readLine("firstName  ");
String lastName = console.readLine("lastName?  ");
// thisIsAnExampleOfCamelCasing
console.printf("Hello, my name is %s\n", firstName);
console.printf("%s is learning how to write Java\n", firstName);
console.printf("First name: %s\n", firstName);
console.printf("Last name: %s\n", lastName);

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Hi Stanley,

You have all the correct code for the 4 tasks to pass; however, you also have code that the Challenge did not ask for, and that is why you are getting the Bummer!. Even though the code you added is syntactically correct, Challenges / Tasks and the instructions associated with them are very specific and very picky. If the instructions aren't followed exactly, it often will result in the Bummer!.

Here you have 2 extra lines of code that was not asked for. The Hello my name is ... and the ... is learning how to write ....
If you just delete those two lines, everything will pass.

Keep Coding! And remember, if the instruction don't ask for it ... don't do it. :)
Other than that - Good Job.