Java OCA OCP Practice Question 1097

Question

Which of the following segments of a for loop can be left blank?

for (segmentA; segmentB; segmentC) { 
} 
A.   segmentA 
B.   segmentB 
C.   segmentC 
D.   All of the above 


D.

Note

A for loop is allowed to have all three segments left blank.

In fact, for(;;) {} is an infinite loop.




PreviousNext

Related