Я несколько раз сталкивался с подобной ситуацией:
while (true) {
while (age == 5); //What does this semi-colon indicate?
//Code
//Code
//Code
}
The while(true)
indicates that this is an infinite loop, but I have difficult understanding what the semi-colon after the while
condition accomplishes, isn't it equivalent to this? :
while (age == 5) { }
//Code
//Code
Другими словами, означает ли это, что цикл while
бесполезен, поскольку он никогда не входит в блок?