在Java中,`String args[]`的用途是什么?

huangapple go评论82阅读模式
英文:

What is use of String args[] in Java?

问题

因为我是一个初学者,我不太能理解为什么要使用String args[],我想知道我们为什么要使用它。

英文:

I want to know that why do we use String args[] because I am a beginner and I am not able to understand why do we use it.

答案1

得分: 1

以下是您在运行程序时传递给程序的参数。

例如,您可以运行 java MyProgram -param -verbose -enableSomething -key=value

所有这些 -param-verbose 等都是这些参数。

请参阅文档:https://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html

英文:

These are the parameters which you pass to your program when running it.

For example, you can run java MyProgram -param -verbose -enableSomething -key=value

All these -param, -verbose, etc are those arguments.

See docs: https://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html

huangapple
  • 本文由 发表于 2020年5月3日 12:48:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/61569749.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定