Cloning object in JAVA
<p>I can not understand the mechanism of cloning custom object. For example:</p>

<pre><code>public class Main{

    public static void main(String [] args) {

        Person person = new Person();
        person.setFname("Bill");
        person.setLname("Hook");

        Person cloned = (Person)person.clone();
        System.out.println(cloned.getFname() + " " + cloned.getLname());
    }
}

class Person implements Cloneable{

    private String fname;
    private String lname;

    public Object clone() {

        Person person = new Person();
        person.setFname(this.fname);
        person.setLname(this.lname);
        return person;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public void setLname(String lname){
        this.lname = lname;
    }

    public String getFname(){
        return fname;
    }

    public String getLname() {
        return lname;
    }
}
</code></pre>

<p>This is example shows right way of cloning as a in the books write. But I can delete implements Cloneable in the class name definition and I receive the same result.</p>

<p>So I don't understand the proposing of Cloneable and why clone() method is defined in class Object? </p>
