It would help to use an IDE. It will show you exactly where the errors are without even having to compile.
As for the ArrayIndexOutOfBoundsException
Code
public static int countString(File fileName)
throws FileNotFoundException
{
Scanner fileInput = new Scanner(fileName);
int count = 0;
String tmp;
while (fileInput.hasNext())
{
fileInput.next();
count++;
}
}
This function doesn't return anything
change it to
Code
public static int countString(File fileName)
throws FileNotFoundException
{
Scanner fileInput = new Scanner(fileName);
int count = 0;
String tmp;
while (fileInput.hasNext())
{
fileInput.next();
count++;
}
return count;
}