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 45 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


Bigfoot1984

  • Member
  • Posts: 321
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

To combat osteoporosis, changes in lifestyle and diet are recommended. At-risk patients should include 1,200 to 1,500 mg of calcium daily either via dietary means or with supplements.

Did you know?

Always store hazardous household chemicals in their original containers out of reach of children. These include bleach, paint, strippers and products containing turpentine, garden chemicals, oven cleaners, fondue fuels, nail polish, and nail polish remover.

Did you know?

Asthma attacks and symptoms usually get started by specific triggers (such as viruses, allergies, gases, and air particles). You should talk to your doctor about these triggers and find ways to avoid or get rid of them.

Did you know?

Medication errors are more common among seriously ill patients than with those with minor conditions.

Did you know?

Blood in the urine can be a sign of a kidney stone, glomerulonephritis, or other kidney problems.

For a complete list of videos, visit our video library