Crafting a custom Java exception

Report a typo

In Java, how can we create a custom exception named 'OutOfNumberRangeException'? It should require a custom message when being thrown and also accept an extra parameter that represents the invalid number causing the exception. The exception class should store this number for future reference and provide a method to retrieve it.

Select one or more options from the list
___

Create a free account to access the full topic