字符的输入 in和out
char c =' ';
System.out.print("Please input a char:");try{
c =(char)System.in.read();}catch(IOExpection e){}
System.out.println("You have entered: "+c);
字符串的输入
try{
BufferedReader in =newBufferedReader(newInputStreamReader(System.in));
System.out.print("Please input an int:");
s = in.readLine();}catch(IOExpection e){}
转为数字型 n = Integer.parseInt(s);
n = Double.parseDouble(s);}
文本界面的输入:使用Scanner类class ScannerTest{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); System.out.print("请输入一个数: "); int a = scanner.nextInt();//nextDouble(); Sy...