can subclass method infere exceptions of its superclass method code example

Example 1: what is the superclass in exceptions

Throwable class is the parent class of all runtime ERRORS and EXCEPTIONS

Example 2: can subclass method infere exceptions of its superclass method

Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
If the superclass method declares an exception, subclass overridden method can declare same, subclass exception or no exception but cannot declare parent exception.

Example 3: can subclass method infere exceptions of its superclass method

Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
If the superclass method declares an exception, subclass overridden method can declare same, subclass exception or no exception but cannot declare parent exception.

Tags:

Misc Example