About Question enthuware.ocpjp.v8.2.1752 :

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

Moderator: admin

Post Reply
robhun79
Posts: 9
Joined: Thu Feb 02, 2023 12:18 pm
Contact:

About Question enthuware.ocpjp.v8.2.1752 :

Post by robhun79 »

The explanation for the fifth option sounds:
"If the object graph contains non-serializable objects, an exception is thrown and nothing is serialized. Object graph means all the objects that are linked/referenced by the first object (directly or indirectly) that is being serialized. Fields of an Object that are marked as transient are not serialized and so they do not cause an exception. Any field that is not marked transient but points to an object of a class that does not implement Serializable, will cause an exception to be thrown. Thus, the given statement is wrong."

So, what if we have a superclass which does not implement Serializable interface? Will then an exception be thrown as well? Probably not, because otherwise we wouldnt be able to deserialize objects with such a superclass. Can you please explain this?

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

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

Post by admin »

No, the type of the superclass has no impact on the object graph. Superclass is not a separate object.
If you like our products and services, please help us by posting your review here.

robhun79
Posts: 9
Joined: Thu Feb 02, 2023 12:18 pm
Contact:

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

Post by robhun79 »

Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 88 guests