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 trialCesar Daniel Gonzalez Estrada
2,546 PointsStep 3 console.printf ("s% can code in Java!/n", firstName); What's wrong with my code?
String firstName = "Cesar";
console.printf ("s% can code in Java!/n", firstName);
What's wrong with my code?
3 Answers
bzfchen
6,484 PointsIt should be %s instead of s%
Also, \n instead of /n
Jakob Wozniak
17,896 PointsYou need %s for the string and %n for the new line. Good luck!
abmsc86
4,949 Points\n not %n for new line. :)
Jakob Wozniak
17,896 PointsActually, %n is a command for System.getProperty("line.seperator"), and is more consistent than \n. The \n works, but it gives you a Unix style line ending, just like \r\n gives you a Windows line ending.
%n will always find the system's new line function, so it's a best practice for this.