保存包含一系列对象的对象

发布于 2025-02-13 18:58:34 字数 190 浏览 1 评论 0原文

假设我有一个对象。它在对象上的特征之一是它包含了现在与自身不同的对象数组

,我想保存该容器以及其中的所有对象。是否会序列化并保存该对象,将其保存到内部存储或共享流程中,还可以保存所有包含的对象(也可以序列化),或者该数组只是参考数组?

上下文是我的应用程序具有简单对象的数组,其本身包含简单对象的数组。我需要确保他们的数据保持持久和一致。

Let's say I have an object. And one of the characteristics of that on object is that it contains an array of objects different from itself

Now, I want to save that container as well as all the objects inside of it. Would Serializing and saving that object, into internal storage or sharedPreferences, also save all of the contained objects(that are also serializable), or is that array just an array of references?

The context is my application has arrays of simple objects, that themselves contain arrays of simple objects. And I need to make sure that their data remains persistent and consistent.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文