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 trialPatrick Heflin
6,281 PointsChallenge 2, Question 3 of Java Basics
Dose not make sense.
// I have setup a java.io.Console object for you named console
String firstName = "daniel";
console.printf ("%s can code in Java!", firstName);
3 Answers
Steve Hunter
57,712 PointsYou're a step ahead! It wants exactly what the question says:
// I have setup a java.io.Console object for you named console
String firstName = "Steve";
console.printf("<YOUR NAME> can code in Java!");
No prizes for guessing what step 3 is!! ;-)
Steve.
Iagor Moraes
18,678 PointsIn Challenge 2, question 2 is :
// I have setup a java.io.Console object for you named console String firstName = "Iagor"; console.printf("Iagor can code in Java!");
Question 3:
// I have setup a java.io.Console object for you named console String firstName = "Iagor"; console.printf("%s can code in Java!", firstName);
Patrick Heflin
6,281 PointsIt was the space after printf before the bracket. Thanks guys!
Patrick Heflin
6,281 PointsPatrick Heflin
6,281 PointsHi! This was step 3. It was asking me to replace YOUR NAME in the console.printf expression with the firstName variable using the string formatter. Can you tell what I am doing wrong? Thanks!
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsIt'll be the space after
printf
before the bracket. I just tried it to test that out.console.printf ("%s can code in Java!", firstName); // wrong
console.printf("%s can code in Java!", firstName); // right