Given:
You want to implement the java.io.Serializable interface to the MyPersistenceData class.
Which method should be overridden?
Given:
You want to implement the java.io.Serializable interface to the MyPersistenceData class.
Which method should be overridden?
To implement the java.io.Serializable interface to the MyPersistenceData class, you don't need to override any methods. The Serializable interface is a marker interface, which means it does not declare any methods that need to be implemented. It simply marks the class as being serializable, meaning its objects can be converted into a byte stream and subsequently restored. Therefore, the correct option is B.
To implement the java.io.Serializable interface to the MyPersistenceData class, you don’t need to override any methods. The Serializable interface is a marker interface that doesn’t have any methods. It simply indicates that the class is serializable and its objects can be written to and read from a stream. Therefore, the correct answer is B. nothing.
Correct answer is B
B is ok java.io.Serializable is a marker interface
B. nothing When a class implements the java.io.Serializable interface, it does not need to override any methods. This interface is a marker interface and does not contain any methods. Serialization and deserialization are handled automatically by the Java Virtual Machine (JVM).
B is correct interface Serializable does not have any method
Answer: C