Oracle
1Z0-819 · Question #199
You want to implement the jav MyPersistenceData class so that it can be serialized and deserialized into a file. Which interface and methods would you implement?``java public class MyPersistenceData…
The correct answer is A. Io, serializable interface to the MyPersistenceData class. See the full explanation below for the reasoning.
Question
You want to implement the jav
MyPersistenceData class so that it can be serialized and deserialized into a file. Which interface and methods would you implement?```java
public class MyPersistenceData {
String str;
public void methodA() {
System.out.println("methodA");
}
}
Options
- AIo, serializable interface to the MyPersistenceData class.
- BThe serializable interface.
- CThe readExternal and writeExternal method
- DThe writeObject method
- ENothing!
How the community answered
(32 responses)- A84% (27)
- B3% (1)
- D9% (3)
- E3% (1)
Community Discussion
No community discussion yet for this question.