Advantages of Object cloning in Java

Java 8Object Oriented ProgrammingProgramming

Java keeps references of objects. If two reference are pointing to same object then modification to one reference will reflect in another reference as well. To prevent such situation, cloning is required. In cloning, a copy of object is to be created and used to that both objects can be modified independently. This is one of the major advantage of cloning.

Published on 06-Feb-2018 17:56:36