Why we used break and continue statement in java?
Answer / Pooja Agarwal
The 'break' statement is used to exit a loop prematurely, while the 'continue' statement is used to skip over the current iteration of a loop and move on to the next one. Both are used for loop optimization and to control flow.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is set and get methods in java?
What are the kinds of polymorphism?
How can we avoid including a header more than once?
Where is stringbuffer stored?
Can we able to pass objects as an arguments in java?
Explain the difference between getAppletInfo and getParameterInfo?
What is the Set interface?
Differentiate between a class and an object.
How long will it take to learn java?
Is char * a string?
1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?
Which list is sorted in java?