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?
-
1Does this answer your question? Why does Java have transient fields?alea– alea2020-08-15 18:47:49 +00:00Commented Aug 15, 2020 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– Michael2020-08-15 18:51:45 +00:00Commented Aug 15, 2020 at 18:51
-
1I think this will make it more clear stackoverflow.com/questions/36351555/…Traycho Ivanov– Traycho Ivanov2020-08-15 19:03:01 +00:00Commented Aug 15, 2020 at 19:03
Add a comment
|