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.
About Question enthuware.ocpjp.v8.2.1712 :
Moderator: admin
-
- Posts: 11
- Joined: Mon Jan 18, 2016 4:35 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1712 :
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.
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.
-
- Posts: 11
- Joined: Mon Jan 18, 2016 4:35 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1712 :
Thanks for the explanation
-
- Posts: 37
- Joined: Mon Jun 12, 2017 2:16 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1712 :
And why is option 4 wrong ?
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1712 :
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.
Who is online
Users browsing this forum: No registered users and 32 guests