Well,
I'm not EXACTLY sure what you are trying to do, but here are a few suggestions that may help.
You have class Quiz that has two arrays, so I assume the attributes will look something like this.
public class Quiz
{
String[] questions; //I'm assuming the arrays hold strings
String[] answers;
}
If you wanted to return just one answer or question at a time you could use a 'getAnswer' or 'getQuestion' method that takes an index as a parameter and returns the element at that index.
This is sort of how it would be used in your main method:
// Create your quiz. Let's assume it has all the q's and a's
// programmed in already.
Quiz myQuiz = new Quiz();
String myAnswer;
// Get the answer for question 5 (or 6, if you haven't taken
// into account the zero-based array)
myAnswer = myQuiz.getAnswer(5);
If you wanted to return the entire array you could have a method called getAnswerList() (or getQuestionList() ) that would look like this:
public String[] getAnswerList()
{
return answers;
}
Then your other class could get access to the array by calling it's method, like this:
String[] myAnswers = myQuiz.getAnswerList();
Another option (which you MAY already be doing) is to use a two dimensional array, so you could have one array that holds both the question AND the answer in the same array.
Let me know if this helps,
-Mike