nerdexam
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)
  • A
    84% (27)
  • B
    3% (1)
  • D
    9% (3)
  • E
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice