Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
m Reverted edits by 150.104.250.202 (talk) (HG)
Copy constructors: fix redirect
Tags: Mobile edit Mobile app edit
Line 67:
 
=== Copy constructors ===
{{also|Copy constructor (C++)}}
 
[['''Copy constructor]]sconstructors''' define the actions performed by the compiler when copying class objects. A copy constructor has one formal parameter that is the type of the class (the parameter may be a reference to an object).
It is used to create a copy of an existing object of the same
class. Even though both classes are the same, it counts as a conversion