3 ms·
An object has nothing to do whether it is allocated on the stack or the heap. C++ has had stack-allocated objects for decades. Also, favoring composition over
by kaba0 4y ago
An object has nothing to do whether it is allocated on the stack or the heap. C++ has had stack-allocated objects for decades.
Also, favoring composition over inheritance has been a major mantra of Java since forever.