public StackException(String message, Throwable cause) {
super(message, cause);
}
in the above code what StackException does after the method is invoked
public StackException(String message, Throwable cause) {
super(message, cause);
}
in the above code what StackException does after the method is invoked
What's happening here is that the constructor StackException
is just passing the message
and cause
to its super class. And so, the regarding super class constructor is invoked.
Don't be confused by Exceptions, it is just like any other Java inheritance.
Now, you just need to see what is the the super class of StackException
and see what its constructor is doing.
Here super class constructor is invoked through stack exception. Don't relate here throw able with errors and exception.