使用Scanner获取键盘输入
```java
package p71;
import java.util.Scanner;
public class ScannerKeyBoardTest {
@SuppressWarnings("resource")
public static void main(String[] args) {
System.out.println("请输入内容:");
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
System.out.println("键盘输入的内容是:"+sc.next());
}
}
}