what is the need of copy construction?
Answers
Answered by
0
Answer:
The class needs to be able to specify exactly how the copy should be created. Thus, C++ uses a copy constructor in the preceding example to create a copy of the object ms on the stack during the call of function fn()
Answered by
1
- I hope it helps you
- mark brainlist
A copy constructor in a Java class is a constructor that creates an object using another object of the same Java class. That's helpful when we want to copy a complex object that has several fields, or when we want to make a deep copy of an existing object
Similar questions
Computer Science,
1 month ago
Social Sciences,
1 month ago
English,
1 month ago
Hindi,
3 months ago
Science,
3 months ago
Physics,
10 months ago