Learn more in the app.
View in app
Compare Iterations Statements For and While - Java Quiz Question
Compare the following programs ForSample1, ForSample2 and WhileSample
Output of all the three programs is same.
Output of ForSample1 and ForSample2 is same, but they are different from WhileSample.
Output of ForSample2 and WhileSample is same, but they are different from ForSample1.
ForSample2 does not compile since there is no code before first semicolon and no code after second semicolon.