What is serialVersionUID? What is a serialVersionUID and why shoshould I use it? Two good articles have thoroughly explained this problem. 1. Why do I need this serialVersionUID? Version control. The Class A object is serialized to A file, and A is upgraded to A'. The content in the file is deserialized and converted to A'. Do you expect it to report an error? 2. Why cannot I use the default value? The default generation rules are very trick and also related to the platform. This unpredictable feature can cause trouble. For example, if the visibility of a domain changes from private to public, you expect the serialVersionUID to remain unchanged. However, if you use the default value, it may change and you cannot control it. 3. is adding serialVersionUID a one-time task? No. Otherwise, it becomes a decoration and cannot take effect of Version Control. When we confirm that the class upgrade is not backward compatible, serialVersionUID ++ is a good habit.