HI,
The key point here to note here is that the constructors are not called while deserializing the object.While serializing the object,the constructors will be called.
So while serializing the b,superclass constructors are called..output is 1 2.then while deserilasing the object,since the food is not serialised,its constructor is called once again and the output is 1 and finally restore and 42.