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 trialJordan vanThiel
529 Pointsconsole.readLine
Why do I need to use System.console().readLine(); in sublime text but in work spaces we dont use System
3 Answers
andren
28,558 PointsIn the workspace they instantiate the console for you using this line:
Console console = System.console();
That makes it so console
is set to System.console()
. If you include that line for yourself at at the top of your class in sublime then you should be able to just use console.readLine()
as well.
Alexander Davison
65,469 PointsThis is because Craig did this in his file:
Console console = System.console();
Craig will tell you how this works in a later video
~Alex
Jordan vanThiel
529 PointsThank you!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsDarn it. Answered at the same time.
Your answer is better
andren
28,558 Pointsandren
28,558 PointsNah I'd say our answers are about equal. But we do really have a tendency to answer around the same time don't we .
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsNo I meant to say for this question.
Sorry Jordan for getting a little off-topic Lol