{"id":4586,"date":"2014-03-30T13:43:20","date_gmt":"2014-03-30T13:43:20","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/in-java-serialization-if-a-class-has-multiple-objects-composition-then-in-what-order-the-state-will-be-retrieved-collection-of-common-programming-errors\/"},"modified":"2014-03-30T13:43:20","modified_gmt":"2014-03-30T13:43:20","slug":"in-java-serialization-if-a-class-has-multiple-objects-composition-then-in-what-order-the-state-will-be-retrieved-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/in-java-serialization-if-a-class-has-multiple-objects-composition-then-in-what-order-the-state-will-be-retrieved-collection-of-common-programming-errors\/","title":{"rendered":"In Java Serialization if a class has multiple objects (composition) then in what order the state will be retrieved?-Collection of common programming errors"},"content":{"rendered":"<p>If you serialise <code>A<\/code> it will be written out as:<\/p>\n<ul>\n<li>Start of <code>A<\/code><\/li>\n<li><code>a<\/code><\/li>\n<li><code>b<\/code><\/li>\n<li><code>c<\/code><\/li>\n<li>End of <code>A<\/code><\/li>\n<\/ul>\n<p>Deserialisation reads the stream in the same order that serialisation wrote it. However, the serialised stream is just a sequence of octets and may have <code>a<\/code>, <code>b<\/code> and <code>c<\/code> in a different order (the fields will only ever be assigned at most once).<\/p>\n<p>Further, the objects could have other references to one another. For instance, even if there is no way at runtime that <code>Test<\/code> can reference <code>Another<\/code>, deserialisation of <code>b<\/code> could include the object that is deserialised to <code>c<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you serialise A it will be written out as: Start of A a b c End of A Deserialisation reads the stream in the same order that serialisation wrote it. However, the serialised stream is just a sequence of octets and may have a, b and c in a different order (the fields will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4586","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4586"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4586\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}