문제

My understanding is serialVersionUID is applicable only to classes, because we can create an object only to classes and the concept of serialVersionUID is for object serialization and deserialization.

도움이 되었습니까?

해결책

It is not required, and more importantly, it will not have any effect on how serialization works in your application.

Since serialVersionUID should be static, even if you add it to your interface, it won't be inherited, so you'll need to add one to your implementing class, too. Similarly, if you extend a serializable base class, you need to add serialVersionUID again.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top