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

tushar beri
tushar beri
73 Points

I wrote the correct syntax but it shows the error

what should I do to remove error

Multiple.java
// I've imported java.io.Console for you.  It is stored in a variable called console for you.
String name=console.readLine("enter your name  ");
console.printf("%s is my name",name);
String pastTenseVerb=console.readLine("enter past tense verb");
console.printf("%s is the past tense verb",pastTenseVerb);
console.printf("\n %s really %s this coding exercise. ", name, pastTenseVerb);
Abu Muhariba
Abu Muhariba
1,140 Points

I literally just copied and pasted your code and it worked...

What error are you getting?

tushar beri
tushar beri
73 Points

I got this error " Bummer! Make sure you are passing name and pastTenseVerb to the console.printf in the correct order"

1 Answer

K Cleveland
K Cleveland
21,839 Points

The challenge asks you to output a sentence that takes both the name and past tense verb using a single statement.

console.printf("%s is the past tense verb",pastTenseVerb);
console.printf("\n %s really %s this coding exercise. ", name, pastTenseVerb);

It seems like this task will fail if there are multiple outputs.