1. import jave.io.File;
  2. import java.io.FileNotFoundException;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Stats
  7. {
  8.     private static final String FILE_NAME = "numbers.txt";
  9.     private int length = 0;
  10.  
  11.     public static void main (String[] args)
  12.     {
  13.         Stats test = new Stats();
  14.         test.lengthCheck();
  15.     }
  16.  
  17.     public void length()
  18.     {
  19.         try {
  20.             Scanner keys = new Scanner(new File(FILE_NAME));
  21.         } catch (FileNotFoundException ex) {
  22.             System.out.println(ex.toString());
  23.         }
  24.  
  25.         while(keys.hasNextInt()) {
  26.             length++;
  27.             System.out.print(length);
  28.         }
  29.     }
  30. }