When a class implements Serializable, it should have a static final field named ______.

  • classVersion
  • serialVersion
  • serialVersionUID
  • versionID
When a class implements the Serializable interface, it's recommended to have a static final long serialVersionUID field. This field helps ensure that the serialized and deserialized versions of the class are compatible. It's used to verify that the class being deserialized is compatible with the one that was originally serialized. The other options are not standard.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *