> I guess im not understanding what you guys are trying to say, I have
> some coding skills but I don't understand a lot of it so far. I
[quoted text clipped - 9 lines]
> private static String answerFile=null;
> private static int num=qNumber();
This won't work, because qNumber() is called when the class is loaded:
before the constructor is called that sets questionFile to another value
than null (hopefully).
> private static int qnum=0;
> private static int anum=0;
> //String array variables to hold questions and answers
> static String[] questions=new String[num];
> static String[] answers=new String[num*5];
That's a lot of static fields, while you initialize them in your
constructor. In this case, don't make them static: when you create a
FileIn object, they are all initialized anyway.
Also, don't initialize "questions" and "answers" yet: you don't know the
number of questions and answers until you know the files (in the
constructor).
> public FileIn(String qF, String aF)throws FileNotFoundException,
> IOException
[quoted text clipped - 12 lines]
> BufferedReader Q= new BufferedReader(new FileReader(questionFile));
> String numQ=null;
I know it's nitpicking, but don't call this variable "numQ"; the prefix
"num" suggests a number. My choice would be "string": a descriptive name
that tells me the variable doesn't contain anything important.
> numQ=Q.readLine();
> while(numQ!=null)
[quoted text clipped - 3 lines]
> }
> }
Is "num" initialized to 0 before the while loop is reached? It will be
if you remove the assignment from the declaration, because 0 is the
starting value for a member variable of type "int".
> //Beginning to read in Questions and Answers
> int x=0, y=0;
> String Qu=null;
> String An=null;
> StringTokenizer Ans;
Here is a good moment to initialize "questions" and "answers": you now
their length (assuming the number of answers equals the number of
questions; you don't check this).
questions = new String[num];
answers = new String[num];
> Qu=question.readLine();
> An=question.readLine();
[quoted text clipped - 9 lines]
> }
> }
> //Method to find the number of questions and deposit into an int
> variable, num
[quoted text clipped - 11 lines]
> return(n);
> }
Remove this method after you've convinced yourself you don't use it.
> //Method to return the question numbered by the qnum variable
> public String getQuestion()
[quoted text clipped - 3 lines]
> }
> }
Are you sure you want each question (and probably answer) to be given
only once? If so, you may want to name this method "nextQuestion".
Oscar

Signature
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website
PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2