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 47 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
YES! Correct, THANKS for helping me on my review


xiaomengxian

  • Member
  • Posts: 311
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

According to the National Institute of Environmental Health Sciences, lung disease is the third leading killer in the United States, responsible for one in seven deaths. It is the leading cause of death among infants under the age of one year.

Did you know?

Pubic lice (crabs) are usually spread through sexual contact. You cannot catch them by using a public toilet.

Did you know?

By definition, when a medication is administered intravenously, its bioavailability is 100%.

Did you know?

For high blood pressure (hypertension), a new class of drug, called a vasopeptidase blocker (inhibitor), has been developed. It decreases blood pressure by simultaneously dilating the peripheral arteries and increasing the body's loss of salt.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

For a complete list of videos, visit our video library