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

TEN 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.

Name.java
// I have setup a java.io.Console object for you named console
String firstName = "Darryl";
console.printf ("%s can code in Java!",firstName);

shouldnt be System.out.printf(%s can code in Java!", firstName);

2 Answers

Darryl, 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);

ahha the space.. nice spot :D

Thanks man you were right I was wrong.

Just 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!