What's the serialver syntax to get the serialVersionUID of an array?

John Zukowski

You need to pass in the array "type" after the [ character, and before a ; character. If the type is a class, add the letter L and the fully qualified class name. If the type is a primitive, the type codes are specified in ObjectStreamField.getTypeCode(), you can almost just capitalize the first letter and place after [. Though, that isn't always the case. For boolean, use Z instead of B, for long use J since L is already taken for classes and interfaces.

For instance, for the String class the syntax is

serialver "[Ljava.lang.String;"
For an array of int elements, it is:
serialver "[I;"
About | Sitemap | Contact