Correct custom exceptions

Report a typo

Which of the following custom exceptions is correctly defined?

a)

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

b)

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

c)

class CustomException3: Exception {
    constructor() : super()
    constructor(cause: Throwable?) : super(cause)
}

d)

class CustomException4: Exception {
    constructor() : super()
    constructor() : super(message: String?)
    constructor() : super(cause: Throwable?)
}
Select one or more options from the list
___

Create a free account to access the full topic