Java Reference
In-Depth Information
Finally, I have to show you an example that illustrates how much simpler Groovy I/O
streams are than Java streams. Consider writing a trivial application that does the follow-
ing:
1 . Prompts the user to enter numbers on a line, separated by spaces
2 . Reads the line
3 . Adds up the numbers
4 . Prints the result
Nothing to it, right? The next listing shows the Java version.
Listing B.4. SumNumbers.java , an application to read a line of numbers and add them
Search WWH ::




Custom Search