myinput.java
来自「一个java写的日历程序」· Java 代码 · 共 40 行
JAVA
40 行
import java.io.*;
public class MyInput
{
//read a string from thekeyboard
public static String readString()
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in),1);
//Declare and initialize the string
String string = " ";
//Get the string from the keyboard
try
{
string =br.readLine();
}
catch(IOException ex)
{
System.out.println(ex);
}
//Return the string obtained from the keyboard
return string;
}
//Read an int value from the keyboard
public static int readInt()
{
return Integer.parseInt(readString());
}
//Read a double value from the keyboard
public static double readDouble()
{
return Double.parseDouble(readString());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?