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

Total Post:782

Points:3910
Java 
 1144  View(s)
Ratings:
Rate this:
  1. 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!