I can't figure out what the error is.
public void quizTest ()
{
c = new Console();
int total = 34;
String[] quizArray = new String [total];
String quizQuestions;
int i = 0;
int u = 0;
try
{
FileReader readQuestion = new FileReader ("QuizQuestions1.txt");
BufferedReader buffReadQuestion = new BufferedReader (readQuestion);
while ((quizQuestions = buffReadQuestion.readLine ()) != null)
{
quizArray [u] = quizQuestions;
u++;
}
for (i = 0 ; i > u ; i++)
{
c.println (quizArray [i]);
}
}
catch (IOException e)
{
new Message ("Error");
}
}
Here's the error message:
java.lang.ArrayIndexOutOfBoundsException: 34
at BooleanLogic.quizTest(BooleanLogic.java:342)
at BooleanLogic.main(BooleanLogic.java:367)