Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package game;
- import java.io.*;
- public class GameHelper {
- public String getUserInput(String prompt) {
- String inputLine = null;
- System.out.print(prompt + " ");
- try {
- BufferedReader is = new BufferedReader(new InputStreamReader(
- System.in));
- inputLine = is.readLine();
- if (inputLine.length() == 0)
- return null;
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
- return inputLine.toLowerCase();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement