posted 14 years ago
Source - K &B chapter 6, Page 455
The Output is -
before: Fido 35
after: Fido 42
This is fine as Animal class didn't implement Serializable interface so weight got its intialized value of 42.
My question is if I modify Animal class as -
The output is
before: Fido 35
after: Fido 0
Can somebody please explain why in this case I am getting 0 for weight instead of 42?
Thanks,
Sushant