What is Cloneable Interface ?

#1
Cloneable - It's a Tagged/Marked interface.

- Tagged/Marked interface means those interfaces don’t have any methods.
- We use these Tagged/Marked interfaces for the special purposes only.

If we want to Clone any object of Class, that Class must implement the Cloneable interface evan though there is no methods in that interface.
 
#2
A class actualizes the Cloneable interface to show to the Object.clone() strategy that it is legitimate for that technique to make a field-for-field duplicate of occurrences of that class. ... By tradition, classes that execute this interface should supersede Object.clone (which is secured) with an open technique.
 
Top