Tuesday, July 16, 2019

Object Serialization with Inheritance in Java

Case 1: If superclass is serializable then subclass is automatically serializable
Case 2: If a superclass is not serializable then subclass can still be serialized
Case 3: If the superclass is serializable but we don’t want the subclass to be serialized
Calse 4: What happens if an object is serializable but it includes a reference to a non serializable object?


Q- When to add readObjectNoData() during serialization?
Q-What happens when a subclass class is serializable but its superclass is not?
Q- How to Serializing Java Objects with Non-Serializable Attributes or reference?
Q- How do you serialize a transient variable in Java?
Q- Transient vs Static variable java?

Q- Serializing Objects into Database? or How to serialize object and store to database?
Answer: see here Serialize Object To Database
Q- How to serialize object and store into cache?
Answer:  see here Serialize Object And Store Into Cache
Q- How to serialize object and store into file?

No comments:

Post a Comment