我目前有这个代码,需要用户输入伪ify一些单词发送出来,并在稍后对整数提交模糊处理.我只需要获得用户输入.任何人都有一个很好的api源来得到这个?我想我应该找系统.命令.
提前致谢 :)
该Scanner班是在Java 5.0中实现,使越来越输入更快更轻松:
Scanner input = new Scanner(System.in)在System.in将允许控制台输入.
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
/* will wait for input then assign it to the variable,
* in this case it will wait for an int.
*/
System.out.println(i); // will print the variable
Run Code Online (Sandbox Code Playgroud)
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html
| 归档时间: |
|
| 查看次数: |
73460 次 |
| 最近记录: |