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 and Variables

Gauseeban Iyathurai
Gauseeban Iyathurai
362 Points

Hi, why not use: System.out.println(""); Instead of console.printf(""); Want that be faster?

Hi, I have been taught that you could print text using: System.out.println("My name is Craig"); Want that be a better way of printing text as opposed to Console console = System.console(); console.printf("My name is Craig"); I did not manage to print text on IntelliJ IDEA by using the console.print method. Why is that? Could you please explain?

1 Answer

Brendon Butler
Brendon Butler
4,254 Points

I think they use console because it integrates well with the workspaces. Intellij doesn't support console (at least not natively). You would have to compile your code and run it externally to get it to run. For the course it's easier to type console.printf(""); than System.out.printf(""); over and over again.

For Intellij you can just use System.out.printf/println(""). And if you type sout and press the tab character on your keyboard it will auto fill to System.out

Said Gaforov
Said Gaforov
809 Points

I was going to ask the same question, looks like you already answered it. I took a java course with Udacity, they used System.out from the very beginning, therefore I was confused here.