what is an virtual function

Answer Posted / nishi tomar

A virtual function is a member function of a class, whose
functionality can be over-ridden in its derived classes. It
is one that is declared as virtual in the base class using
the virtual keyword. The virtual nature is inherited in the
subsequent derived classes and the virtual keyword need not
be re-stated there. The whole function body can be replaced
with a new set of implementation in the derived class.

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a protected class in java?

762


What is the difference between the size and capacity of a vector?

794


Is an empty arraylist null?

805


How static variable work in java?

825


What is r in java?

788


What is the purpose of nested class in java?

822


What is the function of compareto in java?

808


What is the use of toarray () in java?

791


Write a program to print all permutations of string?

909


What is methods and methodology?

791


Which one of the following suits the description of a string better: derived or primitive?

738


Which is easier netbeans or eclipse?

822


Is arraylist ordered?

784


What are the advantages of user defined functions?

760


whatis Home interface and Remoteinterface? with example?

1768