Command-line arguments: Difference between revisions
Content added Content deleted
m (→{{header|C++}}: Minor formatting changes) |
|||
Line 1,306: | Line 1,306: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
The arguments will be passed to <code>main</code> as the only parameter.<br /> |
|||
⚫ | |||
<syntaxhighlight lang="java"> |
<syntaxhighlight lang="java"> |
||
⚫ | |||
/* arguments are passed to the program via 'main' */ |
|||
⚫ | |||
⚫ | |||
for (String arg : args) |
|||
System.out.println(arg); |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
Running this command |
Running this command |