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 trialsohib yhya
80 Pointscan not be solved
this question i can not solve it Call the printf method on the console object and make it write out "<YOUR NAME> can code in Java!" please help me
// I have setup a java.io.Console object for you named console
String firstName = ("sohib");
Console.printf("Hello, my name is sohib");
1 Answer
Alexander Davison
65,469 PointsFirst of all, you are printing the wrong message.
Second, you aren't using formatting.
Third, Console has to be all lowercase letters.
Try this:
String name = "Sohib";
console.printf("%s can code in Java!", name);
Any questions? Please ask below
~Alex
David Tanton
1,937 PointsDavid Tanton
1,937 PointsHi Sohib
Bit of a beginner myself but I think I can see the problem.
The first is a syntax error on the console.printf command. you have started the command with a upper case C.
The second is that you are not in fact using the String firstName in your printf statement as you have hard coded your name directly.
try the following:
("hello, my name is %s ", firstName)
not sure of the correct terminologically but the %s is used by the console.printf to ask for a variable which you add after the comma.