Javatpoint Logo
Javatpoint Logo

Scala Finally

The finally block is used to release resources during exception. Resources may be file, network connection, database connection etc. the finally block executes guaranteed. The following program illustrate the use of finally block.

Scala Finally Block Example

Output:

java.lang.ArrayIndexOutOfBoundsException: 10
Finally block always executes
Rest of the code is executing...





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA