No, they are different.
The first one will be launched while(condition1).
while(condition2), , ;, - .
, , if, for, while, {}, .
:
if (condition)
System.out.println("hello"); // prints only if condition is true.
System.out.println("no"); // not bound to the 'if'. Prints regardless.
while (condition)
; // do nothing!
System.out.println("something"); // not bound to the while
while Java
7.6 while
A while :
while (condition) {
statements;
}
while :
while (condition);