Since abstract class and interface cannot be instantiated hence serialization is not applicable, however what is the purpose of allowing transient variables in abstract class?
Asked
Active
Viewed 331 times
1
-
1Does this answer your question? [Why does Java have transient fields?](https://stackoverflow.com/questions/910374/why-does-java-have-transient-fields) – alea Aug 15 '20 at 18:47
-
3What if you are serializing a child class? You would be okay with Java implicitly only serializing half your object, would you? That sounds like desirable behaviour, does it? – Michael Aug 15 '20 at 18:51
-
1I think this will make it more clear https://stackoverflow.com/questions/36351555/transient-variable-inherited-and-subclass-is-serialized – Traycho Ivanov Aug 15 '20 at 19:03