title: How to properly override clone method?
body: <p>I need to implement a deep clone in one of my objects which has no superclass.</p>
  
  <p>What is the best way to handle the checked <code>CloneNotSupportedException</code> thrown by the superclass (which is <code>Object</code>)?</p>
  
  <p>A coworker advised me to handle it the following way:</p>
  
  <pre><code>@Override
  public MyObject clone()
  {
      MyObject foo;
      try
      {
          foo = (MyObject) super.clone();
      }
      catch (CloneNotSupportedException e)
      {
          throw new Error();
      }
  
      // Deep clone member fields here
  
      return foo;
  }
  </code></pre>
  
  <p>This seems like a good solution to me, but I wanted to throw it out to the StackOverflow community to see if there are any other insights I can include. Thanks!</p>