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

Can a static block throw exception?

879


Can extern variables be initialized?

702


How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?

823


Why string is called as immutable?

736


What is covariant return type?

890


How do you do descending order in java?

771


Does java have a compiler?

807


What are the characteristics of Final,Finally and Finalize keywords.

955


What is a nullable field?

797


What are 5 boolean operators?

860


What are streams in java 8?

790


Can list be null in java?

792


Why static functions are used?

831


Why char array is preferred over string for storing password?

861


What is class and its types?

810