标签:
java输入模板:
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; } }
标签:
原文地址:http://www.cnblogs.com/yongssu/p/4921959.html