Command-line arguments: Difference between revisions

m (→‎{{header|C++}}: Minor formatting changes)
Line 1,306:
 
=={{header|Java}}==
The arguments will be passed to <code>main</code> as the only parameter.<br />
The /* 'args'array is non-null */.
<syntaxhighlight lang="java">
public static void main(String[] args) {
/* arguments are passed to the program via 'main' */
public static void main(String[] args) {
/* 'args' is non-null */
for (String arg : args)
System.out.println(arg);
}
</syntaxhighlight>
Running this command
118

edits