To clone an object of a class we implement the Cloneable interface, and override the clone method:
protected Object clone() throws CloneNotSupportedException{
return super.clone();
}
The above super.clone() calls Object's native API clone().
In case of Serializable the instanceof check is done in ObjectOutputStream class. Similarly, I am trying to find out where does the compiler check whether the object is an instanceof Cloneable or not? Is the check performed natively?