It keeps giving me this exception when it seems like I am adding a choice to my choices vector, and I don't know why.
Here is that snippet of code. If you need more I can provide it.
Thanks ahead of time.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;
public class multipleChoice extends question
{
public Vector<String> choices;
public multipleChoice()
{
System.out.println("Please enter the text of your question: ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String textIn = br.readLine();
text = textIn;
System.out.println("Please enter the answer of your question: ");
BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));
try {
String AnsIn = br.readLine();
answer = AnsIn;
BufferedReader inStream = new BufferedReader (
new InputStreamReader(System.in)
);
System.out.println("Enter the number of choices: ");
String inLine = inStream.readLine();
int numChoices = Integer.parseInt(inLine);
for (int j = 0; j < numChoices - 1; j++) {
System.out.println("Please enter choice number " + (j + 1) + ": ");
BufferedReader br3 = new BufferedReader(new InputStreamReader(System.in));
try {
String choice= br.readLine();
choices.add(choice);
} catch (IOException e) {
e.printStackTrace();
}
}
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}