Java OCA OCP Practice Question 501

Question

Suppose you are writing a class that will provide custom serialization.

The class implements java.io.Serializable (not java.io.Externalizable).

What access mode should the writeObject() method have?

  • A. public
  • B. protected
  • C. default
  • D. private


D.

Note

Default serialization is by passed only if the writeObject() method has private access.




PreviousNext

Related