Computer Applications
What is the use of break statement in Java?
Java Iterative Stmts
2 Likes
Answer
The break statement terminates the current loop or switch statement. The execution then continues from the statement immediately following the current loop or switch statement.
Answered By
1 Like
Related Questions
Give the output of the following program segment. How many times is the loop executed?
for(x=10; x>20;x++) System.out.println(x); System.out.println(x*2);Write a program in Java to find the Fibonacci series within a range entered by the user.
Sample Input:
Enter the minimum value: 10
Enter the maximum value: 20Sample Output:
13How many times will the following loop execute? Write the output of the code:
int x=10; while (true){ System.out.println(x++ * 2); if(x%3==0) break; }