C++ Interview Questions
By David Maisonave
www.axter.com
Describe the three main parts of OO.
· polymorphism
· encapsulation
· inheritance
What is an abstract class?
· A class that has at least one pure virtual function
· Can not be instantiated
Why use virtual destructors?
Abstract class should always have a virtual destructor, unless absolutely sure that the descendant class will not be deleted via base class pointer.
This is true even if the descendant class has no objects to destroy. Otherwise according to the C++ standard, it will result in undefined behavior.
Section 5.3.5 in the Standard:
"3. In the first alternative (delete object), if the static type of the operand is different from its dynamic type, t
|
This is only the first few lines of this paper. If you would like to view the entire paper you need to register here.
|
Get Instant Access to 100,000 Essays!!
|
|