What is virtual Function.

Answer Posted / poonam

Virtual function is a function that uses keyword "virtual"
with the datatype of the function. When the base class as
well as the derived class contains a function both having
the same name, just to resolve ambiguity and copy of the
same data again and again we use the keyword "virtual"
preeceeding it. It is used to achieve poymorphism.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain virtual inheritance?

780


Can we create object of interface?

698


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6583


What is overloading in oops?

703


How to improve object oriented design skills?

657






Give two or more real cenario of virtual function and vertual object

1953


What language is oop?

673


How to call a non virtual function in the derived class by using base class pointer

5574


What is destructor example?

687


Why is polymorphism needed?

694


Can a varargs method be overloaded?

702


What is encapsulation selenium?

636


Can a destructor be called directly?

689


Prepare me a program for the animation of train

2085


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1558