Return to site

JAVA CERTIFICATION QUESTION: Read and write objects by using serialization

· java,ocp

Given:

Constraint: Item class code can't be modified.

Which of the following changes allows an order to be properly serialized?

A. Add this new method to the Order class:

B. Add this new method to the Order class:

C. Add this new method to the Order class and mark the items instance variable transient:

D. None of the above

 

The answer is D.