Java Read numbers from a file, calculate the sum of the numbers, output the numbers & sum to a file

preview_player
Показать описание
To read input from a disk file,  the Scanner class relies on another class, File, which describe disk files and directories. 

Then use the File object to construct a Scanner object:

Scanner in = new Scanner (inputFile);

To write output to a file, you construct a PrintWriter object with the desired file name.

Рекомендации по теме
join shbcf.ru