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 trialLathan Griffith
Courses Plus Student 243 PointsConsole Console?
Why use console console?
I am not an absolute beginner and In my opinion its easier to learn from a scratch workspace, but why are you using console?
Public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello world,");
System.out.println("This is nothing special.");
}
return 0;
}
Would perform the same task.
3 Answers
Craig Dennis
Treehouse TeacherWe are going to be building a console application. Console is the proper abstraction, and I didn't want to get into using too many objects before introducing them. Stick with it, I use System.out.println
in the next course.
Trying to avoid the cognitive overload, which happens to just about everyone who attempts to learn this overly verbose language. ;)
That make sense?
Andrew McCormick
17,730 PointsIt would seem they chose this way because he wants to illustrate working with multiple lines . In the Video he puts a new line character after Hello World line in your example to show creating a new line, where as your example would put both messages in one line, then return to next line.
Grigorij Schleifer
10,365 PointsWhy downvoting Andrews answer?
Upvoted
Lathan Griffith
Courses Plus Student 243 PointsI see, that still isnt answering my question, I am asking is why are they running off of console?
wouldnt
public class FirstProject {
public static void main (String[] args) {
have the same affect?
Lathan Griffith
Courses Plus Student 243 PointsLathan Griffith
Courses Plus Student 243 Points/* Edit
or in my case I would run it as one line.
System.out.println("Hello world, This is nothing special\n");