Answer:
See explaination
Step-by-step explanation:
public class Question {
private String question;
// Answer
private String firstAnswer;
private String secondAnswer;
private String thirdAnswer;
private String fourthAnswer;
// Correct answer
private String correctAnswer;
/**
*
* atparam question
* atparam firstAnswer
* atparam secondAnswer
* atparam thirdAnswer
* atparam fourthAnswer
* atparam correctAnswer
*/
public Question(String question, String firstAnswer, String secondAnswer, String thirdAnswer, String fourthAnswer,
String correctAnswer) {
super();
this.question = question;
this.firstAnswer = firstAnswer;
this.secondAnswer = secondAnswer;
this.thirdAnswer = thirdAnswer;
this.fourthAnswer = fourthAnswer;
this.correctAnswer = correctAnswer;
}
// getter and setter
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getFirstAnswer() {
return firstAnswer;
}
public void setFirstAnswer(String firstAnswer) {
this.firstAnswer = firstAnswer;
}
public String getSecondAnswer() {
return secondAnswer;
}
public void setSecondAnswer(String secondAnswer) {
this.secondAnswer = secondAnswer;
}
public String getThirdAnswer() {
return thirdAnswer;
}
public void setThirdAnswer(String thirdAnswer) {
this.thirdAnswer = thirdAnswer;
}
public String getFourthAnswer() {
return fourthAnswer;
}
public void setFourthAnswer(String fourthAnswer) {
this.fourthAnswer = fourthAnswer;
}
public String getCorrectAnswer() {
return correctAnswer;
}
public void setCorrectAnswer(String correctAnswer) {
this.correctAnswer = correctAnswer;
}
// toString method for print the question
atOverride
public String toString() {
return question + "\\" + firstAnswer + "\\" + secondAnswer + "\\" + thirdAnswer + "\\" + fourthAnswer;
}
}
Note: The at in the lines of the program should be converted to at symbol.
/******************************qustions.txt*****************************/
Which is a reserved word in the Java programming language?
A. method
B. native
C. subclasses
D. reference
B
Which is a valid keyword in java?
A. interface
B. string
C. Float
D. unsigned
A
Which is the valid declarations within an interface definition?
A. public double methoda();
B. public final double methoda();
C. static void methoda(double d1);
D. protected void methoda(double d1);
A
Which is a valid declarations of a String?
A. String s1 = null;
B. String s2 = 'null';
C. String s3 = (String) 'abc';
D. String s4 = (String) '\ufeed';
A