Java error code
<p>I have tried to Google the error code I am getting from NetBeans, but I cannot find out where I am going wrong with my code. </p>

<pre><code>import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Author Jason
 *
 * @fileName Quiz2.java
 *
 */
public class Quiz2 {

public static void main(String[] args) {

    System.out.println("Star Wars Originals quiz.\n");

    // Initialize the questions; each question will contain the answer list
    Question2 questions[] = initializeQuestions();

    Scanner userInput;
    int option;

    for (int i = 0; i &lt; questions.length; i++) {

        // display the question text
        System.out.println(questions[i].getQuestionText());

        // display the available answers for the question
        questions[i].printAnswers();

        boolean correctAnswer = false;
        do {
            userInput = new Scanner(System.in);
            try {
                option = userInput.nextInt();
            } catch (InputMismatchException e) {
                // user did not enter an integer
                option = -99;
            }

            // display the appropriate message if the answer is correct or
            // not.
            if (option == questions[i].getCorrectAnswer()) {
                System.out.println("Congratulations! That Force Is Strong With You. \n");
                correctAnswer = true;
            } else {
                System.out.println("Do Not Fail Me Again.");
            }
        } while (!correctAnswer);
    }

}

/**
 * Creates questions.
 *
 * @return array of &lt;code&gt;Question&lt;/code&gt; type.
 */
private static Question2[] initializeQuestions() {
    Question2 questions[] = new Question2[6];

    questions[0] = new Question2("In Episode IV, who destroyed Luke's aunt and uncle's home:");
    questions[0].addAnswer(new Answer2("Jawas."));
    questions[0].addAnswer(new Answer2("Stormtroopers.", true));
    questions[0].addAnswer(new Answer2("Sand People."));
    questions[0].addAnswer(new Answer2("Wamprats."));

    questions[1] = new Question2("In Episode V, who betrayed his best friend to the Empire on Bespin:");
    questions[1].addAnswer(new Answer2("Lobot."));
    questions[1].addAnswer(new Answer2("Han Solo."));
    questions[1].addAnswer(new Answer2("Boba Fett."));
    questions[1].addAnswer(new Answer2("Lando Calrissain.", true));

    questions[2] = new Question2("In Episode VI, who kills Jabba The Hutt:");
    questions[2].addAnswer(new Answer2("Princess Leia.", true));
    questions[2].addAnswer(new Answer2("Luke Skywalker."));
    questions[2].addAnswer(new Answer2("Lando Calrissain."));
    questions[2].addAnswer(new Answer2("Han Solo."));

    questions[3] = new Question2("In Episode VI, who destroys the second Death Star:");
    questions[3].addAnswer(new Answer2("Han Solo."));
    questions[3].addAnswer(new Answer2("Luke Skywalker."));
    questions[3].addAnswer(new Answer2("Lando Calrissain.", true));
    questions[3].addAnswer(new Answer2("Unamed X-Wing pilot."));

    questions[4] = new Question2("In Episode IV, who refers Obi Wan to Han Solo and Chewbacca in the cantina:");
    questions[4].addAnswer(new Answer2("The bartender."));
    questions[4].addAnswer(new Answer2("The band."));
    questions[4].addAnswer(new Answer2("The little bat guy."));
    questions[4].addAnswer(new Answer2("Astronaut.", true));

    questions[5] = new Question2("In Episode V, what body party does Luke lose to Darth Vader");
    questions[5].addAnswer(new Answer2("His nose."));
    questions[5].addAnswer(new Answer2("His ear."));
    questions[5].addAnswer(new Answer2("His hand.", true));
    questions[5].addAnswer(new Answer2("His foot."));

    return questions;
}
}
</code></pre>

<p>Question2:</p>

<pre><code>/**
 * A question contains the question text and an array of answers.
 */
class Question2 {

// the question text
private String questionText;
// the answers
private Answer2[] answers = null;

/**
 * Constructs a question with the question text.
 *
 * @param questionText
 */
public Question2(String questionText) {
    this.questionText = questionText;
}

/**
 * Prints on the console the answers available for the question.
 */
public void printAnswers() {
    if (answers != null &amp;&amp; answers.length &gt; 0) {
        for (int i = 0; i &lt; answers.length; i++) {
            System.out.println("    [" + i + "] " + answers[i].getText());
        }
    }
}

/**
 * Adds a new possible answer to the question.
 *
 * @param answer
 */
public void addAnswer(Answer2 answer) {
    if (answers == null) {
        answers = new Answer2[1];
        answers[0] = answer;
    } else {
        Answer2[] temp = answers;
        answers = new Answer2[temp.length + 1];
        for (int i = 0; i &lt; temp.length; i++) {
            answers[i] = temp[i];
        }
        answers[temp.length] = answer;
    }
}

/**
 * Returns the order of the correct answer to the question.
 *
 * @return correct answer position
 */
public int getCorrectAnswer() {
    for (int i = 0; i &lt; answers.length; i++) {
        if (answers[i].isCorrectAnswer()) {
            return i;
        }
    }
    return -1;
}

/**
 * Returns the text of the question.
 *
 * @return
 */
public String getQuestionText() {
    return questionText;
}
}
</code></pre>

<p>Answer2:</p>

<pre><code>/**
 * An answer contains the text for the answer and and attribute to determine if
 * the answer is correct or not.
 */
class Answer2 {

// the text of the answer
private String text;
// the attribute to determine if the answer is correct of not
private boolean correctAnswer;

/**
 * Constructs an answer setting the attribute to determine the correct
 * answer to false.
 *
 * @param answerText the text of the answer
 */
public Answer2(String answerText) {
    this.text = answerText;
    this.correctAnswer = false;
}

/**
 * Constructs and answer setting the answer text as well as the attribute to
 * determine correctness of the answer.
 *
 * @param answerText the text of the answer
 * @param correctAnswer the attribute to determine if the answer is correct
 * or not
 */
public Answer2(String answerText, boolean correctAnswer) {
    this.text = answerText;
    this.correctAnswer = correctAnswer;
}

/**
 *
 * @return the text of the answer
 */
public String getText() {
    return text;
}

/**
 *
 * @return if the answer is correct or not
 */
public boolean isCorrectAnswer() {
    return correctAnswer;
}
}
</code></pre>

<p>When I go to run it I am getting Error: Could not find or load main class quiz2.Quiz2</p>

<p>Thanks for any advice. </p>
