, there for I thought that the serialVersionUID will be ignored, however, in the same book it is said that :
...static class members will also be ignored during
the serialization and deserialization process....
which makes no sens !!!.
...serialVersionUID is stored with the serialized object...
yas sine wrote:yep I know, but how you can explain what static members are not stored, however, UID is stored !!!
I don't have to explain that, because it isn't a correct description of what happens. What happens is, the UID is stored but other static members aren't.
What requires explanation is why the books you quoted don't have a correct description.
This is what you need to know about serialVersionUID.
Now, the only way I can see to implement that rule is by storing the serialVersionUID in every serialized object. But Java implementers are very smart people and for all I know they have implemented that rule in a very smart way which I didn't think of. So nitpicking about whether the serialVersionUID is actually written out is, to me, counterproductive. Whether the documentation actually says that serialVersionUID is actually stored, I don't know.