How do you count the number of lines in a text file Java?

Trương Duy

New member
How do you count the number of lines in a text file Java?
Answer
Java – Count number of lines in a file
  1. Open the file.
  2. Read line by line, and increases count + 1 each line.
  3. Close the file.
  4. Read the count.
 

Tìm kiếm

Back
Top