Top Posters
Since Sunday
7
n
3
j
3
o
2
x
2
c
2
2
p
2
n
2
3
2
C
2
z
2
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 61 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 helped my grade so much Perfect
wrote...

Yesterday
Helped a lot
wrote...

2 hours ago
Thanks
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1021 People Browsing
Related Images
  
 423
  
 55
  
 32
Your Opinion
Who's your favorite biologist?
Votes: 587

Previous poll results: Where do you get your textbooks?