devxlogo

Quick Approach to Creating a Custom RuntimeException

Quick Approach to Creating a Custom RuntimeException

The quickest way to create a custom RuntimeException is as follows (simply extend RuntimeException):

public class IncorrectFileException extends RuntimeException {    public IncorrectFileException(String errorMessage, Throwable err) {        super(errorMessage, err);    }}

devx-admin

Share the Post: