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 trialjoseph bingel
362 Pointsit keeps telling me there is a compiler error when it is asking me to define string firstname set value equal to your nm
string firstname = "joey"; ????
string firstname = "joey";
console.printf (my name is %s)
3 Answers
Steve Hunter
57,712 PointsHi there,
You're pretty much there with just a couple of tweaks. You'll need to have String
with a capital S and the N in name should be capitalised too, as is convention:
String firstName = "Joey";
console.printf("%s can code in Java!", firstName);
I also amended your printf
method for the second/third part of the challenge.
Steve.
Mikkel Rasmussen
31,772 PointsYou are missing serveral things:
- Your variable type (string) need to start with a big S.
- Change variable to firstName with big N to make it easier to read.
- the printf you need to add "%s can code in Java!" and after make a comma and add the firstname.
- end the printf with a semicolon.
String firstName = "joey";
console.printf ("%s can code in Java!", firstName);
catalin stoican
Courses Plus Student 798 PointsString firstName = ''joey"; console.printf ("my name is %s",firstName)