Word Counter in java
<p>The initial problem is to  read a text file from a user, and print a histogram of its word 
Sizes. 
My initial Code is Below but its not working. Please Help!!</p>

<pre><code>import java.util.Scanner;
import java.io.*;
public class wordCounter {

    public static final int Size = 15;

    public static void main(String args[])throws FileNotFoundException{


        int counts[] = new int [Size];
        int count = 0;

        Scanner scan = new Scanner(System.in);
        System.out.print("Enter the  filename ");

        String filename = scan.next();

        Scanner code = new Scanner(new File(filename));
        code.useDelimiter("\\W+");

        while (code.hasNext()) {
            count =0;
            int count1 = counts[Size-1];
            String line = code.next();
            while  (count1&gt;=Size){
                int i = Integer.parseInt(line);
                i  = Size;
                count++;
            }//IF

        System.out.println("Length:" + line);

        }//while

        code.close();
        System.out.println(" The amount of words in the text is" +" " + count);
    }//main
}//CLASS
</code></pre>
