I'm working on my first project for android using java.
I have a questions class ;
public class Question {
private int id;
private String questionText;
private String answer;
private TextView textQuestion;
public Question(int id, String questionText, String answer,TextView textQuestion) {
this.id = id;
this.questionText = questionText;
this.answer = answer;
this.textQuestion= textQuestion;
}
}
I will create arrays and store some questions and answers using this class.But my problem is for example for id = 0 it will be the letter "A" , and i would like to have at least 5 questions for letter "A".
Question[] questions = new Question[24];
questions[0] = new Question(0, "Question","Answer",textView);
If i do like this i can only store one question for id = 0 and letter "A".What should i do ?
Edit : by saying "i would like to have at least 5 questions for letter "A"." i mean there will be questions where answers will start with "A" or B,C etc.Example 5 questions which has answer that starts with "A".Same for every other letter.I can use this class to create question and answer for every single id and letter , but i need to have multiple questions for one id. Like ;
questions[0] = new Question(0, "Question","answer which starts with a",textView);
questions[1] = new Question(1, "Question","answer which starts with b",textView);
questions[2] = new Question(2, "Question","answer which starts with c",textView);