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 trialJarell White
530 PointsMy code works fine in the workspace but is not completing the challenge.
String firstName = console.readLine ("What is your name?");
String lastName = console.readLine ("What is your last name?");
console.printf("%s\n", firstName);
console.printf("%s\n", lastName);
What am I missing here?
3 Answers
Craig Dennis
Treehouse TeacherTake a look at the instructions one more time:
Print out to the screen using the printf method on console, "First name: " and the user's first name.
HINT: The results of what you have there is just the value in the firstName
variable. It seems to be missing a label.
Jarell White
530 PointsWow......
that was much easier than I was making it out to be
console.printf("First name: %s", firstName);
I was just missing the First name: in my string....
Thank you for making me read the task.
Kiyah Stokes
17,631 PointsTry leaving two spaces after the question marks and a period after the %s's
Karl Daly
5,229 PointsString firstName = console.readLine ("What is your name?");
instead of this Try String firstName = console.readLine ("What is your First name?");
Jarell White
530 PointsI also tried this with no luck. I am not sure exactly what they are looking for in this challenge I mean this program will run correctly.
Jarell White
530 PointsJarell White
530 PointsThat still wouldn't help. I am getting the error
Bummer! Ensure you use
"First name"
in your format string.