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 Strings, Variables, and Formatting

Brage Boman
Brage Boman
513 Points

What is a string formatter?

I don't understand why I'm not getting past it. It looks like it should work. The preview works. But it's not letting me pass. So I guess I'm asking what is the string formatter it's telling me to use?

Name.java
// I have setup a java.io.Console object for you named console
String firstName = "Brage Boman";
console.printf ("%s can code in Java!", firstName);

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! First, you're doing great :thumbsup: The problem here is a space. Seriously, just a space. You have a space between printf and your open parentheses. This should not be there. If you remove the space, your code passes!

Hope this helps! :sparkles:

Brage Boman
Brage Boman
513 Points

Thank you, that worked. But now I'm curious why it worked with the space in the second part and not the third. I seem to remember adding the space to see if that was the problem first time around, but seeing it work now, I suppose not. Still, thanks a lot.

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

I honestly don't know why it passed the second step other than to say it might be some idiosyncrasy in the checker. It happens sometimes :sparkles: