ICSE Class 9 Computer Applications Question 5 of 29

Iterative Constructs in Java — Question 7

Back to all questions
7
Question

Question 5

What is an empty statement? Explain its usefulness.

Answer

Empty statement consists only of a semicolon ;. It is useful when we want to make a loop an empty loop.

To make a for loop an empty loop, we write the following code:

for (int i = 1 ; i <=10 ; i ++);