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 Introduction to Your Tools

why we used console printf instead of using system .out.println

why we used console printf instead of using system .out.println

4 Answers

Rashida Range
Rashida Range
209 Points

Hey guys that's not true. The syntax absolutely exists in Java! This was just an option. Knowing the longer version is always best practice in my opinion ;)....There are other questions addressing this same concern.

I don't think System.out.println() exists in Java.

I might be wrong, though... I'm fairly new to Java.

thanks bro..

Seth Kroger
Seth Kroger
56,413 Points

System.out.println() definitely exists as well as System.out.printf(). Console is just a convenience class for some methods on both System.out and System.in.

System.out.println() and System.out.printf() both exist in java. But I am not sure about the console printf that treehouse is using here. Did treehouse write their own class for this? This is totally new way printing on the console in java. I haven't used this before. Are we trying to integrate javascript syntax with java?

Max Yun
Max Yun
277 Points

I don't know... yet, I'm still a beginner.

To My Prev Comment: Console class exists in java. Check this out: http://docs.oracle.com/javase/7/docs/api/java/io/Console.html