About Question enthuware.ocpjp.v8.2.1389 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
bvrulez
Posts: 33
Joined: Sat Feb 15, 2020 12:44 am
Contact:

About Question enthuware.ocpjp.v8.2.1389 :

Post by bvrulez »

The question is "Which of the following approaches can be taken independently of each other so that a Portfolio object can be serialized while preserving the state of the Bond objects contained in Portfolio?"

I translate this as: You want to serialize Portfolio objects including their Bonds. Right?

So I would think that the serialized object must contain the field Bond[] bonds. Does an array not support serialization? Why not just serialize this whole field? Or does it then just serialize the references to bonds objects but leaving out the actual objects it is referencing to? But how will the references to those objects get loaded upon deserialization if the array is transient? I might have preserved the bonds objects but I don't know if they where contained in the array. Thanks a lot!

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1389 :

Post by admin »

Bonds array can't be serialized because Bond is not Serializable. There is a detailed explanation that explains this point with sample code describing how it can be done.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests