nirjari patel wrote:So how is clone() related to cloneable interface ?
In that specific instance, it's related because
Object's
clone() method ensures that whatever called it implements
Cloneable; and if not, throws a CloneNotSupportedException.
The fact is that, as Jeff said, they're very rare - and arguably not even Object-Oriented, since they tend to create dispatch code based on type checking. But unfortunately the world isn't perfect
and, at the time, they were probably the best compromise available.
Winston