ICSE Class 10 Computer Applications
Question 53 of 69
Iterative Constructs in Java — Question 8
Back to all questions 8
Question Question 8
How many times will the following code print "Java"?
for (int i = 1; i <= 5; i ++);
{
System.out.println("Java");
} - 0
- 1
- 5
- 4
1
Reason — Since for loop has a semicolon at its end, the block following the loop will be executed after the for loop is terminated. Thus, Java will be printed only once.