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 trial

Java Java Basics Getting Started with Java Strings, Variables, and Formatting

Program won't run

String firstName = "Mike" ; console printf("Hello my name is %s \n", firstName); console.printf( "%s is learning to write java \n"), firstName:

// I have setup a java.io.Console object for you named console
String firstName = "Mike";
console.printf("Hello my name is %s \n",firtName);

1 Answer

Rob Bridges
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hello, it looks like this was just a simple mistype of the variable firstName in your print statement, other than that your code is fine. it looks like you're trying to pass the variable with the mistype of "firtName"

I do notice that in the later challenges they are going to be very picky about what you right, as in the next one they ask for "<your name> can code in java" and unless that's what passes even if the code is completely correct i.e. you accidentally forget to change it and pass "Hello my name is %s \n",firstName it will say that it is wrong because it did not see the exact string it was looking for.

Something to look out for.

Great job getting it right besides that though!