Name two jump statements and their use.
Answer:
(i) Break Statement: The break
statement is used to exit a loop or terminate a switch statement before it has completed its normal course. It immediately ends the current loop iteration and jumps to the statement following the loop or switch block.
(ii) Continue Statement: The continue
statement is used to skip the current iteration of a loop and proceed to the next iteration. It is particularly useful when you want to skip certain values or conditions within a loop.
Related Articles:
This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.