I created a project similar to what you are talking about. ArrayList works good for it, but you will want to create a class for the questions and answers. Creating a class and passing it to the arrraylist will save you a whole lot of headaches regarding how to keep the questions and answers organized.
You will want something to the effect of:
import java.util.ArrayList;
public class QnA {
strQuestion = "";
strAnswer = "";
}
QnA qna = new QnA();
ArrayList<QnA> qnaArrayList = new ArrayList<QnA>();
qna.strQuestion = "Who is the wildest coyote in the world?";
qna.strAnswer = "Wilie Coyote, of course!!";
qnaArrayList.add(qna);
This is just a cobbled together code piece, I did not test it, I don't want to do
all of your work for you. One thing you NEED to remember though.
Each time you add a question and answer pair to the ArrayList, you need
to create a NEW qna class . . . . as in . . . . QnA qna = new QnA();
If you do not do that, you will just be over-writing the first one you
put in.
You will find it MUCH easier passing a class to the arraylist
than trying to handle the questions and answers individually!
Also, you can modify the class and add more features.
I added file information, correct answer info, and info about
the questions in a header on mine. There is an easy way
to randomize too if you use a class type.