开发者

What happens when I use javaw to run the java program in the following scenario?

Say suppose I am running a java program through command line. And this program requires some data to enter during the execu开发者_运维百科tion. So I was wondering on what happens if somebody uses javaw to run this type of program?

That is how to enter the data to the program?


You can't get interactive input, but if you wanted to read from a file, you could, or you could redirect standard input to a file or pipe.

cat myText.txt | javaw myJavaClass

or Windows

type myText.txt | javaw myjavaClass


You can't. Since javaw doesn't allocate a console you have no way of entering data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜