A+B: Difference between revisions

36 bytes added ,  1 year ago
Line 3,254:
 
=={{header|Java}}==
The task description is somewhat vague, if the 'input stream' is in reference to the data provided at the command line, then Java will parse these values into a ''<code>String''</code> array, accessible via the '<kbd>args'</kbd> parameter of the ''<code>main''</code> method.
<syntaxhighlight lang="java">
public static void main(String[] args) {
Line 3,263:
</syntaxhighlight>
If the 'input stream' is the standard-in, you can use the following.<br />
The ''<code>Scanner''</code> class can be used to "scan" the standard-in stream from left to right, returning the next value requested.
<syntaxhighlight lang="java">
public static void main(String[] args) {
118

edits