As long as we read valid String objects from the input stream we are free to do what we want with the data read. In this case we convert the data read to an integer, accumulate a sum of the numbers we read, and accumulate a total count of the numbers we read. Line 47 is needed to continue reading from the stream. The parseInt method will fail if the String containing the numeric data contains any leading or traling white space. Another part of your programming assignment is to use arrays.
Arrays are important data structures in programming languages.
They contain entities of the same type. The syntax for creating a one-dimensional array of integers with 5 elements is as follows. However, there are some important differences between arrays and other objects. There is no class file called Array. Support for arrays is built into the language.