Java partial (de)serialization of objects

前端 未结 3 362
迷失自我
迷失自我 2021-01-20 02:45

Let\'s say we have 3 Classes:

class foo { // not a singleton
    String s;
}
class bar {
    foo f;
    int i;
}
class baz {
    foo sameF;
}
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-20 03:25

    Mark references you don't want serialized with transient keyword.

提交回复
热议问题