I am using a method to read and add the sums of an individual file. I am just stuck on syntax of adding numbers in a file together.
public static int sumFileContents(String fileName) throws IOException {
FileInputStream myFile = new FileInputStream(fileName);
while (scnr.hasNextInt()) {
int sum = (whats the syntax here? int + next int + next int etc);
}
return sum;