This topic contains a solution. Click here to go to the answer

Author Question: Analyze the following code:public class Test { public static void main (String args[]) {int i = ... (Read 46 times)

silviawilliams41

  • Hero Member
  • *****
  • Posts: 560
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);
}
}

◦ The program compiles despite the semicolon (;) on the for loop line, and displays 4.
◦ The for loop in this program is same as for (i = 0; i < 10; i++) { }; System.out.println(i + 4);
◦ The program has a compile error because of the semicolon (;) on the for loop line.
◦ The program compiles despite the semicolon (;) on the for loop line, and displays 14.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by silviawilliams41 on May 6, 2020

kescobar@64

  • Sr. Member
  • ****
  • Posts: 324
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 25% of students answer this correctly




silviawilliams41

  • Member
  • Posts: 560
Reply 2 on: May 6, 2020
Excellent


okolip

  • Member
  • Posts: 362
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Walt Disney helped combat malaria by making an animated film in 1943 called The Winged Scourge. This short film starred the seven dwarfs and taught children that mosquitos transmit malaria, which is a very bad disease. It advocated the killing of mosquitos to stop the disease.

Did you know?

There are more bacteria in your mouth than there are people in the world.

Did you know?

The average office desk has 400 times more bacteria on it than a toilet.

Did you know?

When blood is deoxygenated and flowing back to the heart through the veins, it is dark reddish-blue in color. Blood in the arteries that is oxygenated and flowing out to the body is bright red. Whereas arterial blood comes out in spurts, venous blood flows.

Did you know?

Excessive alcohol use costs the country approximately $235 billion every year.

For a complete list of videos, visit our video library