The type of the expression must be an array type but it resolved to float

后端 未结 3 981
不知归路
不知归路 2021-01-28 15:19

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         


        
3条回答
  •  再見小時候
    2021-01-28 16:13

    Check again how you set your score:

    void setScore(float[] sco)
    {
        sco = score;
    }
    

    What is sco? What you want to assign to what?

    You are assigning your local variable to the parameter. It should be the other way around. (this.score = sco)

提交回复
热议问题