Multiple constructors

Report a typo

We create a custom exception with the following code:

class MyCustomException: Exception {
    constructor(message: String?) : super(message)
    constructor(message: String?, cause: Throwable?) : super(message, cause)
}

Which are the correct methods to throw a MyCustomException exception?

In the following answer code snippets the otherException is an exception instance.

Select one or more options from the list
___

Create a free account to access the full topic