Should I add the serialVersionUID
field when creating an interface that extends Serializable?
My IDE (Netbeans 8.2) complains that the field is missing. However, to my understanding, serialVersionUID
is only applicable to non-abstract classes (the specific classes that will be instantiated during deserialization).
If serialVersionUID
is necessary, what should I do about interfaces that extend interfaces? Normally, this field is declared in every class down the class heirarchy. While this is also possible for interfaces, it leads to a different IDE warning that fields hide fields.