Cloneable in Java

Cloneable interface is one of the mistake in design in Java. At least I think so 🙂 A class should be implementing Cloneable interface if that class wants to be cloned along with overriding clone() method from Object class. This combination of compulsion makes it quite unusual to implement. Code below: As you can see Student Class is implementing Cloneable interface and also overriding clone() … Continue reading Cloneable in Java