Javatpoint Logo
Javatpoint Logo

Scala Break

Break is used to break a loop or program execution. It skips the current execution. Inside inner loop it breaks the execution of inner loop.

In scala, there is no break statement but you can do it by using break method and by importing scala.util.control.Breaks._ package. Let's see an example.

Scala Break Example



Scala Break Example: Break inner Loop

You can use break statement to terminate execution of inner loop in nested loop.

Let's see an example.


1 1
1 2
1 3
2 1
3 1
3 2
3 3
Next TopicScala comments

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA