Answer Posted / syed abdul gaffur.
CONSTRUCTOR:
Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error.
DISTRUCTOR :
If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is difference between pop and oop?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
Why do we need oop?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What are the types of abstraction?
What do you mean by variable?
What language is oop?
Why is abstraction needed?
What do you mean by abstraction?
Explain the concepts involved in Object Oriented programming.
How does polymorphism work?
write a C++ program for booking using constructor and destructor.
Is data hiding and abstraction same?
what is the drawback of classical methods in oops?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash