google + java util scanner? (Maybe)
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
System.out.println("Please provide some input");
That's all you need to do to ask for input.
How you capture that input and what you do with it i'll leave as an exercise to the reader.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Sun Java Tutorial website always good place to start
Basic I/O . As iamthwee said scanner is what you looking for start so Scanning is your tutorial, reading rest of it will not harm you either
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
That is what you can find in Java tutorials which I gave it to you...
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 901
and what more would you need than have everything predigested for you like that sample does?
Want someone to put in the exact text you want to show your users for you?
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
The only thing I use for input on the CLI is java.util.Scanner .
import java.util.Scanner;
public class Input {
private Scanner scanner;
private String ps = "> ";
public Input {
scanner = new Scanner(System.in);
}
public String input(String prompt) {
System.out.print(prompt + ps);
return scanner.nextLine();
}
}
indienick
Junior Poster in Training
71 posts since Aug 2005
Reputation Points: 23
Solved Threads: 2
never used that, grew up with the original APIs and now use commandline arguments and configuration files exclusively as user interfaces :)
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
indienick
Junior Poster in Training
71 posts since Aug 2005
Reputation Points: 23
Solved Threads: 2