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 Receiving Input

console vs. system

Just start the Java track.

I noticed that they teach you console.printf("Hello Word") But, I download eclipse and it does not recognize it. It uses System.out.print("Hello World").

My question is:

  1. "Are the Java commands different using different programs?"
  2. "Is it an eclipse format?"
  3. "What is the correct one?"

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

That is known thing, both here:

https://teamtreehouse.com/community/readline-not-working-on-eclipse-luna-with-java-version-18045

And in Stack overflow detailed explanation why Console can't be used in any IDE:

http://stackoverflow.com/questions/26470972/trying-to-read-from-the-console-in-java

Since you haven't passed any code or errors, I just inferred that is the problem that you have.

So in two words: do not use Console object in IDE, when you press run button.

You have to use BufferedReader or Scanner for that.

For why questions read more in forums above, it is pretty explanatory...

BTW, before digging into Eclipse, I suggest learning Intellijidea, because if you are on Java Track, soon you'll get to 'Local DEvelopment Environments' Course:

https://teamtreehouse.com/library/local-development-environments

where Craig will teach a lot of helpful tricks. No such great tutorial you will find ever on the web, at least my opinion.

Thank you for the quick response.

It explains a lot "THANK YOU!"