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

James Hilts
PLUS
James Hilts
Courses Plus Student 871 Points

%s not working in the challenge.

When I get to the end of the multiple strings challenge, the challenge will not recognize my %s format and mark my challenge as incorrect.

3 Answers

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

Share your code. It should be like code below:

System.out.printf("%s %s %s %s", "Hello","brave","new","world");
Ludwig Vos
Ludwig Vos
6,256 Points

Perhaps its because you missed out a comma. ' , '

I find that I do it all the time.

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi James,

your code should look like this

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

The String formatter %s will be replaced by your Strings name and pastTenseVerb

Grigorij