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 trialSayudha Lukita
Courses Plus Student 845 Pointsalways got bummer when compile
i'm trying to compile this simple printf, i don't know why. i'm pretty sure nothing wrong with my code
// I have imported java.io.Console for you. It is a variable called console.
String firstName = console.readLine ("first name");
String lastName = console.readLine ("last name");
printf ("First name: %s", firstName);
1 Answer
behar
10,799 PointsHey Sayudha! If your getting a compiler error there is no doubt something is wrong with your code, in this case it has to do with the fact the printf should be a method of the console object. So instead say: console.printf(). Hope this helps!