Why we used break and continue statement in java?



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

Post New Answer

More Core Java Interview Questions

What is set and get methods in java?

1 Answers  


What are the kinds of polymorphism?

1 Answers  


How can we avoid including a header more than once?

1 Answers   Fidelity,


Where is stringbuffer stored?

1 Answers  


Can we able to pass objects as an arguments in java?

1 Answers  


Explain the difference between getAppletInfo and getParameterInfo?

1 Answers  


What is the Set interface?

2 Answers  


Differentiate between a class and an object.

1 Answers  


How long will it take to learn java?

1 Answers  


Is char * a string?

1 Answers  


1) There are 10 different threads in runnable state. Each having priority 1 to 10. How does the CPU schedules or executes these threads?

2 Answers   RBS,


Which list is sorted in java?

1 Answers  


Categories