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!

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 Reviewing Our Feedback

Syntax Doubts

when i was taught java in my college they taught me to use system.out.println("-----"); and for taking input in Scanner ob=new Scanner(); ob=nextInt(); and bla bla bla

but here its completely different like console.readline("-----------"); console.printf("----------");

and even for creating an object i was taught as Class obj=new Class(); but here it is Console console=System.console();

Why is it so these differences,do they mean the same??? please explain in detail..

He's using a package thats easier to do things like console.printf instead of System.out.printf. The Console console=System.console(); is apart of that.

1 Answer

Why it is so different is because when at the college they taught you using an iDE like NETBEANS, ECLIPSE, or INTELIJ iDEA (which i think that's the idea used in treehouse). depending on this idea creating a class has changed but for someone starting from the basics the way treehouse teaches their is the best, why because have been in some company that prefer you coding in a notepad and running it via cmd(command prompt) i.e this company doesn't let their employees download or use any IDE except notepad because of security reasons, as for the console.readLine and the Scanner ob = new Scanner(); both are used for the same reason but depends on what you would like to achieve then you might prefer one than the other (here is a link to help to better understand both http://tinyurl.com/oaxvm3c). I hope i explained in details as much has you would have desired.