title: Deep copy for Class with massive subclass in Java
body: <p>I have this class </p>
  
  <pre><code>class Cars implements Transport, Serializable, Cloneable {
     private String type;
     private Models[] cars;
     private int number;
     private static final long serialVersionUID = 1L;
  
     Cars(String type, int number){
         this.type = type;
         this.number = number;
         cars = new Models[number];
         for (int i = 0; i &lt; number; i++){
             cars[i] = new Models("default"+i, Double.NaN);
         }
     }
      private class Models implements Serializable{
         private String model;
         private double price;
  </code></pre>
  
  <p>and i need to override clone() for deep copying this object with using super.clone(). How can i do this?</p>