Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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!