what is virtual function?

Answer Posted / pooja pimplapure

Virtual, as the name implies, is something that exists in
effect but not in reality. The concept of virtual function
is the same as a function, but it does not really exist
although it appears in needed places in a program. The
object-oriented programming language C++ implements the
concept of virtual function as a simple member function,
like all member functions of the class.
The functionality of virtual functions can be over-ridden
in its derived classes. The programmer must pay attention
not to confuse this concept with function overloading.
Function overloading is a different concept and will be
explained in later sections of this tutorial. Virtual
function is a mechanism to implement the concept of
polymorphism (the ability to give different meanings to one
function).

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write knight tour problem which is present in datastructure

2176


What is the difference between abstraction and polymorphism?

625


What is variable example?

601


Can we define a class within the interface?

567


What is difference between abstraction and encapsulation?

600






How do you explain polymorphism?

600


Why polymorphism is used in oops?

594


what are the different types of qualifier in java?

1847


What is encapsulation example?

559


What is overriding vs overloading?

592


What is interface in oop?

672


What does no cap mean?

600


What is polymorphism explain?

706


What does and I oop and sksksk mean?

667


Can a destructor be called directly?

617