J
Johan
Hi,
This is mayby a simple question, but why do I get an
ArrayIndexOutOfBoundsException after the last question?
.....
String[] questions = { "Question 1", "Question 2", "Question 3",
"Question 4", "Question 5" } ;
String[] data = new String[4];
.....
for (int i = 0; i < counter ; ++i) {
System.out.println(questions);
try {
data = br.readLine(); //I get the exception here according to the
debugger in Eclipse
} catch (IOException e) {
e.printStackTrace();
}
}
What I was trying to do was ask 5 questions and store the replys in
another array and insert them later on in an database.
Does anyone have an suggestion about how to solve this?
tia
Johan
This is mayby a simple question, but why do I get an
ArrayIndexOutOfBoundsException after the last question?
.....
String[] questions = { "Question 1", "Question 2", "Question 3",
"Question 4", "Question 5" } ;
String[] data = new String[4];
.....
for (int i = 0; i < counter ; ++i) {
System.out.println(questions);
try {
data = br.readLine(); //I get the exception here according to the
debugger in Eclipse
} catch (IOException e) {
e.printStackTrace();
}
}
What I was trying to do was ask 5 questions and store the replys in
another array and insert them later on in an database.
Does anyone have an suggestion about how to solve this?
tia
Johan