import java.util.*;
import java.io.*;


public class Ch6Proj1 {



	public static void main(String[] args) {

		// open file
		Scanner fil;
		try { fil = new Scanner(new File("numbers.txt")); }
		catch (FileNotFoundException e) {
			System.out.println("error: numbers.txt not found");
			fil = null;
		}

		int[] occurances = new int[51];

		// process file
		while (fil.hasNextLine())
			try { occurances[Integer.parseInt(fil.nextLine())]++; }
			catch (NumberFormatException e) { } // NaN

		// print results
		for (int i = 0; i < 51; i++)
			System.out.println(i + ": " + occurances[i] + " occurances");


		// count numbers for total
		int total = 0;
		for (int i : occurances)
			total += i;

		System.out.println(total + " numbers read");

	}


};

@@ -58,18 +58,16 @@
 roj1 %7B%0A%0A
-%0A%0A
 %09public 
@@ -283,18 +283,14 @@
 %0A%09%09%09
-fil = null
+return
 ;%0A%09%09

remove NullPointerReference