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

Bernard Medeiros
Bernard Medeiros
204 Points

Java Basics: Challenge Task One

It's tell me, "Bummer! Please make sure you leave your printf statement intact." Even thought it is intact...

Am I just being stupid?

Name.java
// I have setup a java.io.Console object for you named console

String firstName = "Bernard";

console.printf ("%s can code in java!", firstName);

2 Answers

Hi Bernard,

There is no mistake in your code! It happened for me and I think this is the treehouse's compiler problem.

Solution : Removing the space of after printf.

Hope this helps you:)

Jordan Ernst
Jordan Ernst
5,121 Points

there is no compiler issue here. when accessing any method you must use the name of the method followed immediately by(). printf is a method and it must be written like this >> console.printf("");

In challenge task2, printf with the space works correctly. However, it doesn't work in task3. Would you tell me the reason why?

Jordan Ernst
Jordan Ernst
5,121 Points

cakypa3 okay so on question 2 there is a bug with the compiler. for Bernard just remember to put the parentheses directly after the name();