Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import jave.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- public class Stats
- {
- private static final String FILE_NAME = "numbers.txt";
- private int length = 0;
- public static void main (String[] args)
- {
- Stats test = new Stats();
- test.lengthCheck();
- }
- public void length()
- {
- try {
- Scanner keys = new Scanner(new File(FILE_NAME));
- } catch (FileNotFoundException ex) {
- System.out.println(ex.toString());
- }
- while(keys.hasNextInt()) {
- length++;
- System.out.print(length);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement