This is the same as:
for(int i=0 ; i<100;i++)
;
System.out.println(i);
An empty semi-colon counts as a statement. So the for-loop statement is the empty statement, and System.out.println()...
Type: Posts; User: helloworld922
This is the same as:
for(int i=0 ; i<100;i++)
;
System.out.println(i);
An empty semi-colon counts as a statement. So the for-loop statement is the empty statement, and System.out.println()...
No, the parser will take only 1 statement (statement A). The other statements are considered outside the for-loop scope, and thus are not executed as part of the for loop.
That's be similar to...
No, a statement can be a line statement or a block statement.
This is perfectly fine code and will print out 0 to 5. However, it is generally considered good practice to wrap statements after...
A for loop must have this syntax (using regex notation where ? means it's optional):
for(expression?; condition?; expression?)
statement
where expression is any valid single expression...