控制台输入是什么意思? [英] What does console input mean?

查看:336
本文介绍了控制台输入是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

控制台输入是什么意思?

What does console input mean?Is it

Console co=System.console();

BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));

还是 String [] args

推荐答案

String [] args 是调用时传递的命令行参数程序,即

String[]args are the command line arguments passed when calling the program, i.e.

java -jar myProgram.jar arg1 arg2 arg3

将存储 arg1 arg2 arg3


will store arg1, arg2 and arg3 in the args array.

Console co = System.console();

只需将当前控制台对象分配给 co <​​/ code >。

Will just assign the current console object to co.



控制台输入是从键盘输入的,所以在您的情况下是


The console input is the input taken from the keyboard, so in your case it is

BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));

或更简单的方式,

Scanner keyboard = new Scanner(System.in);

这篇关于控制台输入是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆