当可以通过重写writeObject()和readObject()进行自定义序列化时,java外部化有什么用途?
我正在学习java序列化,我有一个疑问,如果可以通过重写类中的writeObject()和readObject()方法来定制默认的序列化过程,那么外部化接口的用途是什么?在哪种情况下需要它
你可以在下面搜索框中键入要查询的问题!
我正在学习java序列化,我有一个疑问,如果可以通过重写类中的writeObject()和readObject()方法来定制默认的序列化过程,那么外部化接口的用途是什么?在哪种情况下需要它
# 1 楼答案
它用于自定义序列化,请参见Guide to the Externalizable
主要用途:
用例:
可能的性能优势: