About Question enthuware.ocpjp.v8.2.1712 :

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

Moderator: admin

Post Reply
mtrikannad
Posts: 11
Joined: Mon Jan 18, 2016 4:35 pm
Contact:

About Question enthuware.ocpjp.v8.2.1712 :

Post by mtrikannad »

Will the following choice not be valid as well "No special change is necessary in the updated class. Objects serialized earlier will be deserialized to the updated class objects but the newly added field will be null." ?

This is assuming the class had a serialVersionUid field. The question doesnt specifically mention if a serialVersionUid exists in the class or not , making it ambiguous.

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

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

Post by admin »

If you look at other options, they all make it clear whether they will work even in the absence of this field or not. But this particular option doesn't even consider the possibility that this field may be defined explicitly and signifies that it doesn't depend on it. That is why it is not correct.

Option 1 is similar. It makes a blanket statement that objects serialized earlier cannot be deserialized to the updated class objects. This is, therefore, incorrect as well for the same reason.

mtrikannad
Posts: 11
Joined: Mon Jan 18, 2016 4:35 pm
Contact:

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

Post by mtrikannad »

Thanks for the explanation

horst1a
Posts: 37
Joined: Mon Jun 12, 2017 2:16 am
Contact:

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

Post by horst1a »

And why is option 4 wrong ?

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

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

Post by admin »

Because as explained in the explanation to option 5 (which is a correct option), it is not a must for a class to explicitly define serialVersionUID. A new version of the class can still manage to have the same serialVersionUID as the older version.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests