Analyze the following code:
public class Test {
public static void main (String args[]) {
int i = 0;
for (i = 0; i < 10; i++);
System.out.println(i + 4);
}
}
a. The program has a compile error because of the semicolon (;) on the for loop line.
b. The program compiles despite the semicolon (;) on the for loop line, and displays 4.
c. The program compiles despite the semicolon (;) on the for loop line, and displays 14.
d. The for loop in this program is same as for (i = 0; i < 10; i++) { }; System.out.println(i + 4);
cd This is a logic error. System.out.println(i + 4) is not a part the for loop because the for loop ends with the last semicolon at for (i=0; i < 10; i++);
You might also like to view...
The ____ Dialog Box Launcher allows you to navigate to a specific date.
A. Select Date B. Date Navigator C. Go To Date D. Move To
If the controls on a form are not grouped in a tabular or stacked layout, you can change the ________ between the controls
A) layout B) sections C) form D) spacing
To calculate the total of values in a group, use the ________ operator
A) Between...And B) Or C) Sum D) Avg
You can typically view stock quotes on news web sites, but you need an online broker for investment activities.
Answer the following statement true (T) or false (F)