Skip to content

Roy Tutorials

Technical… Theoretical… Practical…

  • Home
  • FAQs
  • About Me
  • Home
  • Clone

Tag: Clone

What is Copy Constructor? Sometimes a programmer wants to create an exact but separate copy of an existing object so that subsequent changes to the copy should not alter the original or vice versa. This is made possible using the copy constructor. A copy constructor is a constructor that creates a new object using an…

Leave a Comment on Copy Constructor in Java
Posted in Java

Copy Constructor in Java

Introduction Shallow Copy also means Shallow Clone and Deep Copy also means Deep Clone. Cloning an object is about creating the copy of the original object, i.e., making an identical copy of the original object. By default, cloning in Java is field by field copy i.e. as the Object class does not have idea about…

Leave a Comment on Shallow Copy and Deep Copy in Java
Posted in Java

Shallow Copy and Deep Copy in Java

Categories

Copyright © 2014 - 2022 Roy Tutorials

Privacy | Terms & Conditions