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!
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
mason malone415 Points
i DONT UNDER STAND WHAT I AM DOING WRONG
wHAT IS WRONG IN THE CODE
// I have setup a java.io.Console object for you named console String firstName = "MASDAFORD"; console.printf("MASDAFORD can code in java" , firstName);
When you use
printf to place a variable into a
String you need to place a placeholder character in your
String in the spot where you want to place said variable. The placeholder for
String values is
%s so for this task the string has to look like this:
console.printf("%s can code in java" , firstName);
%s will be replaced by the contents of the
firstName variable by the
printf method when it prints the
Also I think your caps-lock key might be on by accident. Based on the capitalization of your title and post.
Christopher Downie2,546 Points
This task actually requires you to use the
%s to insert you name in the program.
so your code should actually look like
console.printf("%s can code in java", firstName);