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 Perfecting the Prototype String Equality

Hai Phan
Hai Phan
2,442 Points

Why challenge fail when I use print instead of printf?

Hence I just want to print the string inside " ", not any format here, so I think print should work. But it didn't, can someone explain it?

2 Answers

Steven Parker
Steven Parker
231,271 Points

The Console class does not have a method named "print". But "printf" can be used to output a plain string.

See the Console page of the Java manual for more details.

Hey Hai Phan!

print() is not a method inside the Console Class. printf is the primary method for printing. There is also System.out.println(), but I don't think you have gotten to that yet.