步骤如下:
导包(必须放在类class与包名package的中间)
import java.util.Scanner;
1
创建Scanner对象
Scanner input = new Scanner(System.in);