Java uses System.out to refer to the standard output device and System.in to the standard input device. By default, the output device is the display monitor and the input device is the keyboard. To perform console output, you simply use the println method to display a primitive value or a string to the console.Console input is not directly supported in Java, but you can use the Scanner class to create an object to read input from System.in.(Java中System.out和System.in引用标准输入输出设备,默认的标准输入设备就是键盘,输出设备是监视器,我们可以直接用System.out.print方法将字符串输出到控制台,但是从控制台输入信息,需要借助Scanner类创建对象从System.in中读取键盘输入信息)
输入方法:
import java.util.Scanner; //导入相关类
Scanner input = new Scanner(System.in); //创建一个Scanner对象
int intValue = input.nextInt(); //输入一个整数
double doubleValue = input.nextDouble(); //输入一个双精度数

