A question from the K&B 6 mock exam (Q30 of 2nd mock exam):
Which are true? (Choose all that apply.)
A. To implement java.io.Serializable, a class must implement two methods.
B. When an object is serialized, if it has references to other objects, those objects must be serializable.
C. A serialized object can be deserialized only by the same JVM which was used to serialize it.
D. The values in the instance variables marked volatile will not survive serialization and deserialization.
The correct answer (according to the exam) is B.
However, to my thinking, if an object has references to other objects, those objects need not be serializable if they are marked transient. "Those objects must be serialzable" is therefore not true. Perhaps I differ on what "must" means in this context. Or perhaps the questioner meant "To serialize all members of an object" when they said "When an object is serialized".
Regardless, the problem here is not with my understanding of serialization, but rather my understanding of the meaning of the question. I'm not having trouble deciphering Java code, I'm having trouble deciphering the intent of the questioner's English. And this worries me since I have no way of preparing for that.
Have people encountered other questions like this, where figuring out the meaning of the questions themselves is the hurdle you have to overcome?
[ December 20, 2008: Message edited by: Jamie MacDonald ]