What will be the output of the following Java program?class jump_statments {public static void main(String args[]) { int x = 2; int y = 0; for ( ; y < 10; ++y) { if (y % x == 0) continue; else if (y == 8) break; elseSystem.out.print(y + " "); }} }

🎲 Try a Random Question  |  Total Questions in Quiz: 20  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Java Basics Practice Test: Control Statements — practice the complete quiz, review flashcards, or try a random question.

In Java, control statements are used to control the flow of execution in a program. They are used to make decisions, to loop through blocks of code multiple times, and to jump to a different part of the code based on certain conditions.   There are three main types of control statements in Java: Decision-making statements: These statements allow you to make decisions about which block of code to execute based on a condition. The most common decision-making statements are the if, else if, and else statements. Looping statements: These statements allow you to execute a block of code... Show more

What will be the output of the following Java program?<br>class jump_statments <br>{<br>public static void main(String args[]) <br>{<br> int x = 2;<br> int y = 0;<br> for ( ; y < 10; ++y) <br> {<br> if (y % x == 0) <br> continue; <br> else if (y == 8)<br> break;<br> else<br>System.out.print(y + " ");<br> }<br>} <br>}