-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion.java
45 lines (41 loc) · 1.12 KB
/
Question.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.io.*;
import java.util.ArrayList;
/**
* Represents a Question object.
* Questions are inside a quiz.
* Questions contain a string that is the question,
* and a String arraylist with the answer choices.
*
* @author Cole Priser
* @version December 11 2021
*/
public class Question implements Serializable {
private ArrayList<String> answerChoices;
private String question;
/**
* Constructor to create a question object
*
* @param question string that contains the question
* @param answerChoices possible answers to the corresponding question string
*/
public Question(String question, ArrayList<String> answerChoices) {
this.answerChoices = answerChoices;
this.question = question;
}
/**
* Method to get the question string
*
* @return String
*/
public String getQuestion() {
return question;
}
/**
* Method to get the answer choices for it's corresponding question string
*
* @return ArrayList<String>
*/
public ArrayList<String> getAnswerChoices() {
return answerChoices;
}
}