Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What happens to superclass fields during serialization if the superclass is not serializable?
Think about what gets saved when an object is serialized.
In the example of Employee and Person, what attribute would be missing if Person isn't serializable?
Focus on the fields defined in the superclass.
If a superclass is not serializable, its fields will be:
Remember how Java defines serialization with respect to class hierarchies.
True or False: An Employee class that extends a non-serializable Person class can retain the nationality attribute.
Think about the serialization rules again.
Create a Java class hierarchy with a base class that is not serializable. Describe what happens when you serialize an object of a subclass.
Clarify how serialization treats base and derived classes.
Propose a method to ensure that all classes in a complex hierarchy are serializable without repetitive code.
Think about how inheritance can help reduce redundancy.
4 more questions in this section. Enroll free to practise them all.
Enroll free