📄 userinput.java
字号:
package ir.utilities;import java.io.*;/** A place to put some helper functions for interacting with the user * * @author Ray Mooney*/public class UserInput { /** Read a line of input from the user */ public static String readLine() { // Get a reader for receiving input from the console BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); String input = null; try { input = console.readLine().trim(); } catch (IOException e) { System.out.println("\nCould not read from console"); System.exit(1); } return input; } /** Prompt the user with a string and then get a line of input */ public static String prompt(String promptString) { System.out.print(promptString); return readLine(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -