Luis Barahona814 Points
defining a string variable
why am I getting an error on my code for defining a string variable
// I have setup a java.io.Console object for you named console String firstName = "Luis"; cosole.printf("Hello, my name is %s", firstName);
Jason AndersTreehouse Moderator 143,923 Points
You're on the right track, but there are just a couple of things:
- You have a spelling error. "Console" is misspelled (missing an "n").
- The second task specifically asks for the String to be
"<YOUR NAME> can code in Java!", but you have
""Hello, my name is ... ", which is not what the instructions asked for, and this will cause a
Challenge instructions are very specific and need to be followed exactly. Even correct code will fail if the instructions are not followed.
Once you fix up those two small things, the rest looks great!! :)