I hit a bump when I\'m doing my Java code. I feel like I somehow got the concept messed up, like I not sure for this:
void setScore(float[] sco)
{
sco = scor
I guess you mixed up the variable names:
void setScore(float[] sco)
{
sco = score;
}
public void setScore(float sco, int id)
{
sco[id] = score;
}
because score
is the field which you want to populate and sco
is the parameter which you want to populate score
with. The code above does not change any contents of Score
, so try to swap it to
void setScore(float[] sco)
{
this.score = sco;
}
public void setScore(float sco, int id)
{
this.score[id] = sco;
}
it also would have helped if you have started using this
to mark instance fields explicitly.