-4
下面的代码编译,但是当我运行它时,它没有进入while循环。为什么?为什么这个while循环不工作?
while (Str1.equals(Str2)); {
count = 1;
while (count <= maxCount); {
System.out.print(something1);
count = count + 1; } }
下面的代码编译,但是当我运行它时,它没有进入while循环。为什么?为什么这个while循环不工作?
while (Str1.equals(Str2)); {
count = 1;
while (count <= maxCount); {
System.out.print(something1);
count = count + 1; } }
删除分号,分号只是为了do-while.Here添加是你的代码:
while (Str1.equals(Str2))
{
count = 1;
while (count <= maxCount)
{
System.out.print(something1);
count = count + 1;
}
}
感谢您的帮助!这解决了它。 – unforeseencoder
,因为它不是'javascript' – TbWill4321
采取半colen断背',而( Str1.equals(Str2)){}' –
大声笑它是Java! –