What is a serialVersionUID and why should I use it?
Asked 07 September, 2021
Viewed 715 times
  • 52
Votes

Eclipse issues warnings when a serialVersionUID is missing.


  

The serializable class Foo does not declare a static final serialVersionUID field of type long

What is serialVersionUID and why is it important? Please show an example where missing serialVersionUID will cause a problem.

26 Answer