Why does it give me this error and how can I fix it?
Exception in thread âmainâ java.lang.ArrayIndexOutOfBoundsException:0
at Alphabet.main(Alphabet.jaba:9)
import java.io.*;
import java.util.*;
public class Alphabet
{
public static void main(String args[] )
throws IOException
{
BufferedReader in =
new BufferedReader(
new FileReader(args[0]));
String delims =
"How to program java";
int totA = 0, totB = 0, totC = 0, totD = 0, totE = 0, totF = 0,
totG = 0, totH = 0, totI = 0, totJ = 0, totK = 0, totL = 0,
totM = 0, totN = 0, totO = 0,totP = 0, totQ = 0, totR = 0,
totS = 0, totT = 0, totU = 0,totV = 0, totW = 0, totX = 0,
totY = 0, totZ = 0;
// Read lines:
String line;
while ((line = in.readLine()) != null)
{
// Tokenize line:
StringTokenizer strtok =
new StringTokenizer(line, delims, true);
while (strtok.hasMoreTokens())
{
char vowel = strtok.nextToken().charAt(0);
switch(Character.toLowerCase(vowel))
{
case 'a':
++totA;
break;
case 'b':
++totB;
break;
case 'c':
++totC;
break;
case 'd':
++totD;
break;
case 'e':
++totE;
break;
case 'f':
++totF;
break;
case 'g':
++totG;
break;
case 'h':
++totH;
break;
case 'i':
++totI;
break;
case 'j':
++totJ;
break;
case 'k':
++totK;
break;
case 'l':
++totL;
break;
case 'm':
++totM;
break;
case 'n':
++totN;
break;
case 'o':
++totO;
break;
case 'p':
++totP;
break;
case 'q':
++totQ;
break;
case 'r':
++totR;
break;
case 's':
++totS;
break;
case 't':
++totT;
break;
case 'u':
++totU;
break;
case 'v':
++totV;
break;
case 'w':
++totW;
break;
case 'x':
++totX;
break;
case 'y':
++totY;
break;
case 'z':
++totZ;
break;
}//end switch
}//end while
}//end while
System.out.printf("%s%8s\n", "Character", "Total");//column headings
System.out.println("'A's: " + totA);
System.out.println("'B's: " + totB);
System.out.println("'C's: " + totC);
System.out.println("'D's: " + totD);
System.out.println("'E's: " + totE);
System.out.println("'F's: " + totF);
System.out.println("'G's: " + totG);
System.out.println("'H's: " + totH);
System.out.println("'I's: " + totI);
System.out.println("''J's: " + totJ);
System.out.println("'K's: " + totK);
System.out.println("'L's: " + totL);
System.out.println("'M's: " + totM);
System.out.println("'N's: " + totN);
System.out.println("'O's: " + totO);
System.out.println("'P's: " + totP);
System.out.println("'Q's: " + totQ);
System.out.println("'R's: " + totR);
System.out.println("'S's: " + totS);
System.out.println("'T's: " + totT);
System.out.println("'U's: " + totU);
System.out.println("'V's: " + totV);
System.out.println("'W's : " + totW);
System.out.println("'X's: " + totX);
System.out.println("'Y's: " + totY);
System.out.println("'Z's: " + totZ);
}//end main
}//end class