It's because You didn't create an instance of Your 'choices' variable. You need to allocate a memory by adding a line (in constructor i.e.):
choices = new Vector<String>();
Oh, and I think You don't have to catch 3 times still one type of exception one after another. Remove 2 of them leaving 1 big try, so it would be like:
try
{ // <- here starts 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));
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));
String choice= br.readLine();
choices.add(choice);
}
}
}
} // <- here ends try
catch (IOException e) {
e.printStackTrace();
}
Too many brackets too find out, when one starts and where another ends, so I commented only two of them.
BTW: My first post on this forum. Hello! :7