For one of my projects, I need to define a new exception which extends ProviderMismatchException
.
From the javadoc link, you can see that this exception:
- extends
IllegalArgumentException
, which - extends
RuntimeException
, which - extends
Exception
, which - extends
Throwable
.
All of them define their own static final serialVersionUID
except for Throwable
which adds the private
modifier.
Now, if you implement an interface Foo, then all inherited classse also implement that interface, and this stands for Serializable
as well; however, why do subclasses in the JDK redefine it for each subclass? What is the danger of not defining it again for inherited classes?