11 ms·
In most object-oriented languages, there is a very specific time when an object constructor is called (namely, when an object is instantiated) and when
by tzs 16y ago
In most object-oriented languages, there is a
very specific time when an object constructor is
called (namely, when an object is instantiated) and
when its destructor is called (namely, when it falls
out of scope)
Is that actually correct? From what I recall and from what I see after a bit of Googling, it would appear that most object oriented languages either don't even have destructors, or if they have they are called when the object is garbage collected, not when it goes out of scope.
- frou_dh 16y agoThe term 'destructor' alone feeds in to the C++ conflation. In C#, this syntax is more specifically sugar for a 'finalizer' if I'm not mistaken.