WHAT IS THE MAIN DIFFERENCE BETWEEN SHALLOW CLONING AND DEEP CLONING OF OBJECTS IN JAVA?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
Java 
 1484  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What is the main difference between shallow cloning and deep cloning of objects in java?

     Java supports shallow cloning of objects by default when a class implements the java.lang.Cloneable interface.

    Deep cloning through serialization is faster to develop and easier to maintain but carries a performance overhead.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!