-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnswer.java
More file actions
40 lines (32 loc) · 1.11 KB
/
Copy pathAnswer.java
File metadata and controls
40 lines (32 loc) · 1.11 KB
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
import java.io.Serializable;
/**
* Project 4 - Answer
* <p>
* The Answer class implements Serializable and gets the question title and the answer chosen.
* @author Aarohi Panzade, Abel Zazjon, Aditi Barla, and Yaseen Shady 039
*
* @version 11/14/2021
*/
import java.io.Serializable;
public class Answer implements Serializable {
// initializes the fields
private String questionTitle;
private String answerChosen; //answer that the student picked
// Constructs a newly allocated Answer object with the field values specified by the input parameters.
public Answer(String questionTitle, String answerChosen) {
this.questionTitle = questionTitle;
this.answerChosen = answerChosen;
}
// returns the question title
public String getQuestionTitle() {
return questionTitle;
}
//returns the answer chosen
public String getAnswerChosen() {
return answerChosen;
}
//sets the answer chosen instance variable to the value given as a parameter
public void setAnswerChosen(String answerChosen) {
this.answerChosen = answerChosen;
}
}