Type mismatch: cannot convert from int to boolean in while loop

前端 未结 1 990
礼貌的吻别
礼貌的吻别 2021-01-24 22:15

I just started learning java, tried to find the answer but I guess I\'m not smart enough. I\'m trying to write an array which I got from some file into another file.

Th

相关标签:
1条回答
  • 2021-01-24 22:45

    Presumably i is an int, not a boolean. Unlike C/C++, this won't be converted to a boolean implicitly. You must explicitly state your condition as a boolean.

    while (i < arraycomment.length) // or some other constant
    
    0 讨论(0)
提交回复
热议问题