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 trialBernard Medeiros
204 PointsJava 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?
// 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
sara123
16,108 PointsHi 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
5,121 Pointsthere 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("");
sara123
16,108 PointsIn challenge task2, printf with the space works correctly. However, it doesn't work in task3. Would you tell me the reason why?
Jordan Ernst
5,121 Pointscakypa3 okay so on question 2 there is a bug with the compiler. for Bernard just remember to put the parentheses directly after the name();