About Question enthuware.ocpjp.v11.2.3419 :
Posted: Wed Dec 29, 2021 4:18 am
Hello, just a question:
does this not suggest infinite loop? tia
does this not suggest infinite loop? tia
Code: Select all
public long getTotal(String file) throws IOException {
long sum = readFileBuffered(file, (InputStream in) -> {
long current = 0;
for (;;) {
int b = in.read();
if (b == -1) {
return current;
}
current += b;
}
});
return sum;
}