what is virtual function?

Answer Posted / p.kumarasamy,be(cse)

C++ virtual function is a member function of a class, whose
functionality can be over-ridden in its derived classes. The
whole function body can be replaced with a new set of
implementation in the derived class. The concept of c++
virtual functions is different from C++ Function overloading.
C++ Virtual Function - Properties:

C++ virtual function is,

* A member function of a class
* Declared with virtual keyword
* Usually has a different functionality in the derived class
* A function call is resolved at run-time

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are properties in oop?

801


Why is destructor used?

751


What are classes oop?

787


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2052


What is difference between polymorphism and inheritance?

803


Why is polymorphism used?

768


What are the benefits of interface?

796


What is abstraction in oops?

786


What is polymorphism and types?

827


Which method cannot be overridden?

758


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

4325


What is super in oop?

822


What is the advantage of oop over procedural language?

839


Is html an oop?

775


What are the benefits of oop?

857