Does it matter what I choose for serialVersionUID when extending Serializable classes in Java?

No – so long as you change it at the right time (i.e. when you make a change which affects serialization, e.g. removing a field) it shouldn’t matter what value you use.

For simplicity I’d suggest starting with 0 and increasing it by 1 each time you need to.

The serialization spec has more details.

Leave a Comment