the manner of action of scala @Serializable
is different from Java Serializable
?
I mean the way to serialize objects or both use the same standard serialization?
the manner of action of scala @Serializable
is different from Java Serializable
?
I mean the way to serialize objects or both use the same standard serialization?
Well Scala compiles to JVM byte code, so the only difference comes from how Scala implements this conversion. Scala converts the annotation to the interface during type checking which can lead to some subtle problems see here.
Afaik @Serializable is deprecated anyhow - compared to other annotations (volatile annotation instead of a specifier) in scala I don't see much advantages anyhow.. doesn't make the code much clearer or simpler.
Serializable is just a marker interface. You don't need to implement any methods. An annotation is supposed to be a cleaner solution. But the meaning is the same.
© 2022 - 2024 — McMap. All rights reserved.