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
Christopher Klebieko
2,248 PointsUsing readLine in other IDEs (Eclipse, netbean, etc)...
I was wondering how to use the console.readLine() method in other IDEs. IDEs such as Eclipse and netbean do not support importing console and require you to use System.out.printf/ln methods instead for displaying text. How can you use the readLine command without importing console and using System.out.print instead?
Christopher Klebieko
2,248 PointsPerfect that was it thanks!
Phouthalang Pygnasak
4,795 PointsPhouthalang Pygnasak
4,795 PointsHi,
What I think you're looking for is Java.Utils.Scanner class. This will allow you to get input from the console window. Example:
public Scanner scanner = new Scanner(System.in);
public static void main(String[] args) { String input = scanner.next() // there are a lot of different methods for scanner you can use }
Also, here is a stack overflow link to see more examples: http://stackoverflow.com/questions/11871520/how-can-i-read-input-from-the-console-using-the-scanner-class-in-java