Javatpoint Logo
Javatpoint Logo

Scala Custom Exception

In scala, you can create your own exception. It is also known as custom exceptions. You must extend Exception class while declaring custom exception class. You can create your own exception message in custom class. Let's see an example.

Scala Custom Exception Example

Output:

Exception Occured : InvalidAgeException: Not eligible
Next TopicScala Collection





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