I was looking in the Eclipse code styles, to modify the formatting, and came across this:
void foo()
{
;;
label: do
{
} while (false);
}
What is the meaning of the first line in foo() (the ";;")?
I was looking in the Eclipse code styles, to modify the formatting, and came across this:
void foo()
{
;;
label: do
{
} while (false);
}
What is the meaning of the first line in foo() (the ";;")?
There is none. It just shows, that before the label
there can be something. But as the name empty statement already says: it's empty so there is nothing to compute.
first line
;;
is an empty statements, it does not affect on code because java use ; to terminate line.
and
for(;;)
control goes into infinite loop.
;;
means nothing (nothing will be compute, like 2 empty lines)
for (;;)
means infinite loop
Well, this is a template. I guess that line has to be completed with local variable declarations.
Empty statement. It means: don't do anything. It is rarely useful, but as any other statement it can be used in if
:
if(something)
;
else
doSomething();
or while
:
while(a[i++] != 0)
;
Doesn't look like good style anyway.