This "stupid question" is about the serialVersionUID field: what does it do, when do you have to override it (and how), and what can go wrong if you do?
What the heck is serialVersionUID?
This "stupid question" is about the
serialVersionUID, which defaults to being a checksum of a class' fields, methods, and other members. Now that some IDEs emit a warning when you don't override it, the questions are: what is it good for, how and why would you override it, and what could go wrong if you do?
(Not So) Stupid Questions
Editor's note: Sometimes the most interesting discussions begin when someone says, "This may be a stupid question, but ...." If the person asking the question has taken the time to think about the problem before asking, the question is often not stupid at all. The uncertainty points out an ambiguity in the specs, holes in the docs, or a search for how more experienced programmers might address a particular problem. From time to time, we will print one of the "(Not So) Stupid Questions" we receive and invite our readers to answer the question in the feedback section.
Remember that new people are joining the Java community all the time and may be looking for help from those with more experience. Also, those who began with Java as their first language can benefit from those coming to the community with experience in other languages. As always, answer the questions with kindness. You are also welcome to submit your questions to
This may be a stupid question, but ... "What's the deal with
I understand that it is some sort of checksum of the class's name, members, methods, etc.
I also understand that it allows the JVM to detect old or "incompatible" versions of classes being deserialized. But given that you can set it to some arbitrary value with seemingly no ill effects (in fact, Eclipse now warns you when you haven't overridden it), why bother checking at all?
It is solely for detecting deployment issues where, for example, one node of a 40-node environment is still running the previous version? Or have I missed something more fundamental?
And I guess my big question is:
What can go wrong if you do override