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 trialDarryl Vaughn
964 PointsTEN TIMES IVE TRIED IN SO MANY DIFFERENT WAYS ! IS MY STRING FORMATTER INCORRECT. THIS HAS TO BE A BUG.
IM REALLY FRUSTRATED WITH TREEHOUSE BECAUSE IVE TRIED THE FORUM AND NO ONE HAS HELPED ME . MY CODE IS CORRECT SO IT MUST BE TREEHOUSE , BUT THEY REFUSE TO FIX THE PROBLEM.
// I have setup a java.io.Console object for you named console
String firstName = "Darryl";
console.printf ("%s can code in Java!",firstName);
2 Answers
jcorum
71,830 PointsDarryl, you're close. But the treehouse compiler doesn't like the space between printf and the opening parenthesis. Try this instead:
String firstName = "Darryl";
console.printf("%s can code in Java!", firstName);
Oshedhe Munasinghe
8,108 Pointsahha the space.. nice spot :D
Darryl Vaughn
964 PointsThanks man you were right I was wrong.
jcorum
71,830 PointsJust another observation. In jGRASP, an IDE used in a lot of schools, your code would compile and run fine, even with the space:
String firstName = "Darryl";
System.out.printf ("%s can code in Java!",firstName);
Darryl can code in Java!
Oshedhe Munasinghe
8,108 PointsOshedhe Munasinghe
8,108 Pointsshouldnt be System.out.printf(%s can code in Java!", firstName);