-1
我做了一个名为“Question”(Question.java)的新类 通过在创建数组的主要活动中调用它,它表示无法解析符号。代码如下。 在活动无法解析符号
private Question [] mQuestionBank = new Question[] {
new Question (R.string.question_punjab,true),
new Question (R.string.question_cat, true),
new Question (R.string.question_wear, false),
new Question (R.string.question_iPhone, true),
new Question (R.string.question_shahrukh,false)
};
问题类如下
public class Question {
private int mTextResId;
private boolean mAnswerTrue;
public int getTextResId() {
return mTextResId;
}
public void setTextResId(int textResId) {
mTextResId = textResId;
}
public boolean isAnswerTrue() {
return mAnswerTrue;
}
public void setAnswerTrue(boolean answerTrue) {
mAnswerTrue = answerTrue;
}
public Question(int textResiD, boolean AnswerTrue) {
mTextResId = textResId;
mAnswerTrue = answerTrue;
}
}
你的构造有一个错字“textResiD “与”textResId“ – Gerd
并answerTrue vs AnswerTrue – DadoZolic