java接收键盘输入

System.out.print("Please input String to check:");//提示输入
Scanner sc=new Scanner(System.in);//也可以接受文件输入
String str=sc.next();//挨个读取完毕,存储在str中,类型可以是String或int或其他
原文地址:https://www.cnblogs.com/NeilLing/p/4020691.html