how to check the lines in a file java scanner

Solutions on MaxInterview for how to check the lines in a file java scanner by the best coders in the world

showing results for - "how to check the lines in a file java scanner"
Hannah
16 Mar 2019
1int count = 0;
2while (scanner.hasNextLine()) {
3    count++;
4    scanner.nextLine();
5}