Top Posters
Since Sunday
L
4
d
4
3
k
3
k
3
j
3
k
3
b
3
f
3
b
3
d
3
h
3
New Topic  
melinoma86 melinoma86
wrote...
Posts: 386
Rep: 0 0
4 years ago
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.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 66 times
1 Reply
Replies
Answer verified by a subject expert
emneviusemnevius
wrote...
Posts: 389
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

melinoma86 Author
wrote...

4 years ago
This calls for a celebration Person Raising Both Hands in Celebration
wrote...

Yesterday
This helped my grade so much Perfect
wrote...

2 hours ago
Thank you, thank you, thank you!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1042 People Browsing
Related Images
  
 90
  
 392
  
 307
Your Opinion
Who will win the 2024 president election?
Votes: 10
Closes: November 4

Previous poll results: What's your favorite coffee beverage?