Advantages of Object cloning in Java


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.

Updated on: 30-Jul-2019

281 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements