The ________ statement can be used to prematurely exit a loop based on a particular condition.
- Break Statement
- Continue Statement
- Exit Statement
- Return Statement
In Java, the "break" statement is used to prematurely exit a loop based on a particular condition. It is commonly used in "for" and "while" loops to exit the loop when a specific condition is met. The other options (2 to 4) have different purposes and are not used for exiting loops.
Loading...
Related Quiz
- In Java, the ______ operator is used to increment a variable's value by 1.
- ________ is an interface providing thread safety without introducing concurrency overhead for each individual read/write operation.
- Using ________, we can perform cleanup operations when the stream is closed.
- A custom exception can be thrown using the ________ keyword followed by an object of the custom exception.
- When converting byte streams to character streams, which class is useful to handle the conversion?