Originally Posted by
jdeveloperjava
Write a function (or functions) that given a collection of files will produce a sum of integers from each line of each file. Each file can have any number of lines from 1 to N. Each line can contain only one integer and no other alphanumeric characters. All of the numbers from all of the files should be added to the final result. The result is just one number.
This is not really difficult but requires some work with I/O classes (and eventually java.util.Scanner if you like to use it). As hint, try to separate things as much as possible. For example create an apposite method (or even an apposite class) to read/process 1 file. Then composing the reading of N files will be a
breeze. There are several
designs you can choose from to do this.