What is the use of a copy constructor?



What is the use of a copy constructor?..

Answer / Sandhya Yadav

A copy constructor in Java is used to create a new object by initializing it with the values from an existing object. This is useful when we want to make a deep copy of an object, instead of just referencing it.nCopy constructors are invoked implicitly during object creation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we declare an array without size in java?

1 Answers  


What does the @override annotation do?

1 Answers  


Is null an object in java?

1 Answers  


Why is java multithreaded?

1 Answers  


What is difference overloading and overriding?

1 Answers   Cyient,


why java does not contain pointers?

13 Answers   Infosys, TCS,


Can an interface extend a class?

1 Answers  


Why are pointers not secure?

1 Answers  


What is the purpose of the System class?

1 Answers  


What is a class instance variable?

1 Answers   Tech Mahindra,


I want to know the host name and provider name for tcs web mail

5 Answers   RSG, TCS,


What is mnemonic in assembly language?

1 Answers  


Categories