作者:吉祥二宝 | 来源:互联网 | 2022-11-28 15:18
1> Eran..:
您正在尝试将A char
与A 进行比较String
。
将a char
与a 进行比较char
:
while (str.charAt(testing) != guess.charAt(0) && testing != 6)
和
if (str.charAt(testing) == guess.charAt(0))
我还将更改您的停止条件,以免StringIndexOutOfBoundsException
找不到匹配项:
while (testing
和
if (testing