In my examples I use classes Dog and Dalmatian. I trust that everyone knows that Dalmatian is a breed of dog, hence all Dalmatian objects are also Dog objects. A Dalmatian object is a Dog object plus extra fields.
If you convert a Dog to a Dalmatian using a copy constructor, stop using the Dog object because any changes you make to the Dalmatian object Dog fields will not be reflected back in the source Dog object.
If you convert a Dog to a Dalmatian object by having a Dog reference in the Dalmatian object, any changes you make to the Dalmatian object Dog fields will be reflected in the original Dog object.
This page is posted
Optional Replicator mirror
Please read the feedback from other visitors, or send your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
Your face IP:[18.104.22.168]
You are visitor number|