What is virtual function?where and when is it used?
Answer Posted / reshma khan pathan
In object-oriented programming, a virtual function is a
function whose behavior can overridden by a function of
same signature of inherited class.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is the diamond problem in inheritance?
What is the difference between a mixin and inheritance?
What is interface in oop?
Why do we use class in oops?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
Why interface is used?
what is difference between class template and template class?
Which is better struts or spring?
How to hide the base class functionality in Inheritance?
What are the 5 oop principles?
What is object-oriented programming? Webopedia definition
What is advantage of inheritance?
What is solid in oops?
What is encapsulation oop?
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