How can custom exceptions be created in Java?
class MyException extends Exception { }
By using annotations
By extending the Error class
By extending the Exception class
By implementing the Throwable interface