Re: Inheritance of constructors.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Consider an example where a new class (for instance it's constructor) is in charge of the data preparation which is fed to a parent class constructor. OK, you can pass it via static variable as suggested, though what happens if you want to have different data in it for each instance of a new class? Unless static in C# means it exists over the whole cycle of a code execution but doesn't limit it to one global data copy shared amongst all instances like in C++. Is this the case?

Erm, OK, I see what happens in this case. It's passed via static method, the value reference is stored locally in a base class. No harm done unless I would prefer it would be capable of following every change of the value reference in outer classes ... what then?
.



Relevant Pages