Must be an array type but resolved to string

前端 未结 7 965
梦谈多话
梦谈多话 2021-01-16 07:01

I am getting the \"Must be an array type but it resolved to string\" error in my code. It also says that i (in the code below) cannot be resolved to a variable which I don\'

7条回答
  •  余生分开走
    2021-01-16 07:37

    It seems like that you have a few problems with the main syntax of basic java functions like loops or if-else statement. Click here for a good tutorial on these.

    You must correct your for-loop and your if-statement:

    for(int i=0;i

    Now you wont get the Cant be resolved to a variable... exception.

    Second thing is the usage of your string. You have to use it like this:

    for(int i=0;i

    Now all your exceptions should be eleminated.

提交回复
热议问题