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

I see that here we import java.io.Console, is this something that is often used in industry? why not System.out.println?

I seen this variation System.out.println() for printing statements is there are reason that here we use Console.printf?

Hey Yadira,

do you need more information ???

Grigorij

1 Answer

Hi Yadira,

in the course we are creating a console programm, where the user types the input into a console. So it is good to use the Console class methods like printf for this purpose.

I read in Stack Overflow that it is very difficult and not necessary to run Console class applications on an IDE like Eclipse etc. If you are using an IDE for building a programm, it is better to use the Scanner class for storing input from the user.

But it is a good practise to use System.out.println() in console applications and in an IDE for printing text.

Let me know if you need more informations

Grigorij