I created an array in android studio. What does the code below mean?
private question[] questionbank = new question[]{
new question(R.string.question_africa, true),
new question(R.string.question_oceans, false),
new question(R.string.question_mideast, true),
new question(R.string.question_america, false),
new question(R.string.question_asia, true);
I initialized an array from a class called question shown below
public class question {
private int TextInput;
private boolean AnswerInput;
private boolean hasCheated;
public boolean isHasCheated() {
return hasCheated;
}
public void setHasCheated(boolean hasCheated) {
this.hasCheated = hasCheated;
}
public question(int holdsTextInput, boolean holdsAnswerInput) {
this. TextInput = holdsTextInput;
this.AnswerInput = holdsAnswerInput;
}
public int getTextInput() {
return TextInput;
}
public boolean getAnswerInput() {
return AnswerInput;
}
public void setTextInput(int holdsTextInput) {
this.TextInput = holdsTextInput;
}
public void setsAnswerInput(boolean holdsAnswer) {
this.AnswerInput = holdsAnswer;
}
}
However, I wanted some clarification, for instance, what exactly was done here? Did I reference the class question and create an array called questionbank? Also if so why do I need to put in each value as a new question?