title: recursive serialization in java
body: <p>I am working with serialization in Java for the first time.</p>
  <p>I have read that Java recursively serializes objects.</p>
  <p>Say I have a class <code>Diet</code> that holds objects of type <code>fruit</code> which holds objects like <code>apple</code>, <code>banana</code>, <code>pineapple</code>.</p>
  <p>As I have understood it, once I serialize an object of type <code>Diet</code> java stores the other objects in the same vein.</p>
  <p>But: do all classes I intend to be (co-)serialized have to implement <code>Serializable</code> or only the &quot;top-class&quot; (here: <code>Diet</code>)?</p>