Answer Posted / b.balaganesan
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.
Need for Virtual Function:
The vital reason for having a virtual function is to
implement a different functionality in the derived class.
For example: a Make function in a class Vehicle may have to
make a Vehicle with red color. A class called FourWheeler,
derived or inherited from Vehicle, may have to use a blue
background and 4 tires as wheels. For this scenario, the
Make function for FourWheeler should now have a different
functionality from the one at the class called Vehicle.
This concept is called Virtual Function.
| Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
what are the different types of qualifier in java?
What is encapsulation example?
What is overloading in oops?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What language is oop?
What is difference between oop and pop?
What is difference between data abstraction and encapsulation?
What is the point of polymorphism?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
What is object and class in oops?
What exactly is polymorphism?
• What are the desirable attributes for memory managment?
Can we create object of abstract class?
What is a class in oop?
What is object in oop?