![](/img/trans.png)
[英]What are the benefits/drawbacks to serializing a class in a fully serializable hierarchy, vs. Serializable child of non-serializable ancestry?
[英]What is the difference of Implementing Serializable vs. Extending Serializable?
从JMS队列读取对象消息时遇到一些错误。 似乎是在对象序列化期间发生的。
我进入了我们正在使用的域库,对象模型的根类被声明为“ extends Serializable”而不是“ implements Serializable”。
两种方法是否有任何区别,我通常只见过“实现序列化”实现。 这会导致我们看到问题的副作用吗?
extends <interface>
为接口保留。 只有一个接口可以从多个接口扩展。 类(包括抽象类)将仅实现接口。
由于Serializable
是一个接口,因此只有另一个接口可以扩展它。 希望使用接口的所有具体类都必须实现它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.