[英]Future Object serialized on complex object
I want to have a Future object returned from a thread pool, which has complex attributes. 我想从线程池返回一个具有复杂属性的Future对象。 Should I use the serializable interface for this case?
在这种情况下,我应该使用可序列化的接口吗?
No, you shouldn't make it Serializable
unless you actually want to serialize it. 不,除非您实际要对其进行序列
Serializable
否则不应将其设置为可序列化。 In Java built-in ExecutorService
s do not involve serialization. 在Java中,内置的
ExecutorService
不涉及序列化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.