Computer Applications
What is the significance of a break statement in a switch statement ?
Java Conditional Stmts
4 Likes
Answer
The break statement when used inside a switch, ends that case and proceeds to the first statement that follows switch statement. In case, the break statement is missing, the control flows to the next case below the matching case and continues to execute all the cases, till the end of switch statement. This is called fall through.
Answered By
3 Likes
Related Questions
Write the Java expression for the following:
A student incorrectly attempted to produce a random value in the range 1.6 using the expression.
6*(int)Math.random( ) + 1Correct the error in expression above to get the desired result.
What are iteration statements ? Name the iteration statements provided by Java.
What is meant by an entry-controlled loop? Which Java loops are entry-controlled?