title: Java: why class designed for inheritance should contain protected clone method?
body: <p>I'm reading carefully Effective Java (by Joshua Bloch) and I found the following sentence on cloning:</p>
  
  <blockquote>
    <p>If you design a class for inheritance, be aware that if you choose not to provide a well-behaved protected clone method, it will be impossible for subclasses to implement Cloneable.</p>
  </blockquote>
  
  <p>I'm a little bit confused, because in my little test:</p>
  
  <pre><code>public class Cloning {
  
      public static void main(String[] args) throws CloneNotSupportedException {
  
          Woman woman1 = new Woman("Marie Curie-Sklodowska", 33, "Physics");
          Woman woman2 = (Woman) woman1.clone();
      }
  
      static abstract class Person {
          protected String name;
          protected int age;
  
          Person(String name, int age) {
              this.name = name;
              this.age = age;
          }
      }
  
      static class Woman extends Person implements Cloneable {
  
          private String field;
  
          Woman(String name, int age, String field) {
              super(name, age);
              this.field = field;
          }
  
          @Override
          protected Object clone() throws CloneNotSupportedException {
              return super.clone();
          }
      }
  }
  </code></pre>
  
  <p>I'm not getting any error. I think, I do not understand the sentence correctly. Could someone please explain, what the author had in mind?</p>