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

chase singhofen
chase singhofen
3,811 Points

what is a string formatter. video never went over this. thx

Now replace <YOUR NAME> in the console.printf expression with the firstName variable using the string formatter.

what is a string formatter? videos never covered this thx

Name.java
// I have setup a java.io.Console object for you named console
String  firstName = "chase";
//console.printf("firstName");

1 Answer

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

Hi there! At 5:00 of the video just prior to this challenge, Craig Dennis begins talking about what he calls a "format specifier". This is what they mean by string formatters. The %s which is used is a "format specifier" which indicates that the value of a String typed variable will later be placed where the %s is used. I highly recommend reviewing the video from 5:00 to about 6:13 where you are congratulated for your understanding of string formatters. The example given in this part of the video is extremely similar to what is needed in the code challenge.

Hope this helps! :sparkles: