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 trialIsak Anderson
1,084 PointsI'm Stuck on the challenge and I don't know how to get past the error
So the error message says Ensure you use "First name"
in your format string. My code is
String firstName = console.readline("What is your first name? ");
String lastName = console.readline("What is your last name? ");
console.printf("Hello, my name is %s", firstName);
4 Answers
Gloria Dwomoh
13,116 PointsThe challenge is asking you to print ""First name: " and the user's first name."" but you have been printing something else, that is why it sees it as error. It is expecting you to print the sentence it asked from you.
i.e
console.printf("First name: %s", firstName);
Isak Anderson
1,084 PointsString firstName = console.readLine("What is your name? ");
String lastName = console.readLine("What is your last name? ");
console.printf("Hello, my name is %s", firstName);
Gloria Dwomoh
13,116 PointsYou forgot to use camel case in readLine.
Isak Anderson
1,084 PointsThanks for Replying but I did use camel casing in the code I just forgot in the post.. But I used snippets from the previous lesson and I got that to work so I do not know what the problem is..
Gloria Dwomoh
13,116 PointsCan you post your actual code? It is hard to help when you are using another code than the one posted.
Isak Anderson
1,084 PointsIt Worked!!! Thank you sooo much!!! I really appreciate it.
Gloria Dwomoh
13,116 PointsYou are welcome Isak :)