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 Using your New Tools Multiple Format Strings

Getting an error in Exercise 1 Challenge Task 3, it's saying I don't have my variables in the correct order.

I made it through the first two challenge tasks just fine, but it doesn't seem to want to take what I've added for the third. This is my code:

    String name = console.readLine("");
    console.printf("%s", name);
    String pastTenseVerb = console.readLine("");
    console.printf("%s really %s this coding exercise", name, pastTenseVerb);

Am I just missing a line or is this a bug because I get an error saying "Make sure you are passing 'name' and 'pastTenseVerb' to the 'console.printf' in the correct order."

1 Answer

Hi Melissa,

Your first printf statement wasn't called for in the challenge and I think it's throwing off the final output check in the 3rd task.

Your 1st, 3rd, and 4th lines seem fine and will pass the challenge.

Thanks, after I got rid of the second line it worked.