John Daniel wrote:1) Why are the overridding methods private? I didn't think you could override a method with a private one.
You can't. This is not overriding. If K&B says it's overriding, that's incorrect. But perhaps they said it's
like overriding, which is true enough. You're required to match a given set of method signatures exactly, which is quite similar to overriding. But it's not the same thing.
Basically, Java's creators bent the rules here, because they didn't want to force users to make non-private methods exposing private data, just to support serialization. And moreover, no one should ever really use these methods, except the JVM itself. So they chose to make the methods private.
The rules for serialization are special, in that they don't really follow other rules for the Java language (like how overriding works). The serialization rules only work because the people who made the rules also had control of the implementation of the whole JDK including the JVM - so they were able to make special code inside the JVM just to handle this. Don't try this at home.
John Daniel wrote:2) When calling the original methods, why do you have to use defaultWrite/ReadObject? What's wrong with using super?
Since you aren't actually overriding anything, super would not work.