Wednesday 24 October 2018

java - Array classes cannot declare an explicit serialVersionUID

Declaring an explicit serialVersionUID is mostly recommended for serialization but not for array classes as per the last line of javadoc for serialization




Array classes cannot declare an explicit serialVersionUID, so they
always have the default computed value, but the requirement for
matching serialVersionUID values is waived for array classes.





Which array classes javadoc is referring to ?
I am aware of only Arrrays which is a utility class and Array which is final.
So are there any more classes its concerned about ?



Why array classes can't declare an explicit serialVersionUID ?



There is another post but it doesnt explain the reason of not allowing array classes to declare serialVersionUID

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...