I already tried to build a Question Class which the assignment asked for. But I'm really confused about how to use that class in my main class. I know I still need player class to complete the program but I think I'm fine with that class, just really confused with how to call and build the question class. I'm very new to programming and all. Please help me. Thank you so much.
here is the assignment question
Trivia Game Create a program, called Assignment3 that serves as a simple trivia game for two players. The program will work as follows:
Starting with player 1, each player gets a turn at answering a trivia question. (There are a total of 10 questions, 5 for each player.) When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point.
After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner.
You are to design a Question class to hold the data for a trivia question. The Question class should have fields for the following data:
A trivia question
Number of possible answers
Array of possible answers (array of strings)
The number of the correct answer (e.g., 1, 2, 3, or 4)
The Question class should have appropriate constructor(s), accessor, and mutator methods. The Question class should have a static method called createQuestions() that reads question data from a file, creates a Question object for each question in the file, and adds it to an ArrayList. The createQuestions() method take a String as parameter that represents the file name with the questions and returns the ArrayList of Question objects.
The main program should request an ArrayList of Question objects and present 10 of the questions to the players. Create a text file with your own trivia questions on the subject or subjects of your choice for the objects.
The questions file format will contain seven lines per question as follows:
A string containing the trivia question
An int containing the number of possible answers
One or more strings each representing a possible answer
An int pointing to the correct answer (e.g., 1, 2, 3, or 4)
This is the Question class
import java.util.Scanner;
import java.io.*;
import java.util.ArrayList;

public class Question {
private static int NumberofQuest = 10;
private String[] question = new String[NumberofQuest] ;
private static int NumofAns=0;
private String[] possibleAns = new String[NumofAns];
private int[] correctAns = new int[NumberofQuest];
public Question()
{
question= null;
for (int i=0; i<= NumofAns; i++)
{
setPossibleAns("");
}
correctAns=null;
}

public static ArrayList<Object> createquestion(String filename) throws IOException
{
Question qArray[] = null;
File file = new File(filename);
Scanner line = new Scanner(file);

ArrayList<Object> qObject = new ArrayList<>();
while (line.hasNext())
{

for (int i=0; i<= NumberofQuest; i++)
{
qArray[i] = new Question();
qArray[i].setQuestion(line.nextLine());
qArray[i].setNumofAns(Integer.parseInt(line.nextLine()));
for (int j=0; j<= NumofAns; j++){
qArray[i].setPossibleAns(line.nextLine());
}
qArray[i].setNumofAns(Integer.parseInt(line.nextLine()));
qObject.add(qArray[i]);
}

}
return qObject;
}

public void setQuestion(String quest)
{
question[NumberofQuest]= quest;
}
public String[] getQuestion()
{
return question;
}
public void setNumofAns(int num)
{
NumofAns=num;
}
public int getNumofAns()
{
return NumofAns;
}
public void setPossibleAns(String ans)
{
possibleAns[NumofAns]= ans;
}
public String[] getPossibleAns()
{
return possibleAns;
}
public void setCorrectAns(int correctNum)
{
correctAns[NumberofQuest]= correctNum;
}
public int[] getCorrectAns()
{
return correctAns;
}
public static void displayQuestion(Question q, int playerTurn) throws IOException
{
System.out.println("Question for player #" + playerTurn);
System.out.println(q.getQuestion());
for (int i=0; i <= NumofAns; i++)
{
System.out.println(q.getPossibleAns());
}
}


}
This is my main class which is not completed cuz I don't know how to do it T.T
import java.io.IOException;
import java.util.ArrayList;
import java.lang.NumberFormatException;
public class TriviaGame {

/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
int playerturn=0;
ArrayList<Question> qArray = new ArrayList<>();

for (Question q : qArray)
{
q.createQuestion(question, playerturn);
}




}
}