title: Why serialVersionUID is not enforced by Java
body: <p>serialVersionUID seems to me to have a very loose specification. Any body developing a class with serializable interface can burn his hands with InvalidClassException. Also, i saw a fellow dev using int as a datatype rather than long.</p>
  
  <p>So, my question why the Java designers and developers did not do something more concrete like whenever we implement serializable we have to implement a method setting serialVersionUID like the hashcode method. </p>
  
  <p>So, what am i missing ? Does not seem like a double edged sword to me.</p>
  
  <p>Update 1:</p>
  
  <p>My bad i gave a wrong example comparing a class level thing with a instance level thing.I have seen many production issues across different companies because of this. But my general idea was cant it be made more strict by compiler in any way. </p>