Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is virtual function?

Answers were Sorted based on User's Feedback



what is virtual function?..

Answer / purba phalguni mishra, gandhi

The objects of the polymorphic class, addressed by
pointers, change at runtime and respond differently for the
same message.Such mechanism requres postponment of binding
of a function call to the member function [ VIRTUAL] untill
runtime.

Is This Answer Correct ?    15 Yes 9 No

what is virtual function?..

Answer / varun sir

a virtual function is used to avoid duplicacy in derived
classes. suppose that there is a base class which has two
properties a and b. now suppose that two derived classes
named 'der1' and 'der2' are deriving from that base class,
then both properties a and b of base class will be
inherited to both of the derived classes. now if a new
class is derived from 'der1' and 'der2' then both of the
properties a and b of 'der1' and 'der2' will also be
inherited into newly derived class. this will cause
duplicacy in newly obtained derived class. so in order to
avoid this duplicacy , we use virtual functions.

Is This Answer Correct ?    8 Yes 6 No

what is virtual function?..

Answer / 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

what is virtual function?..

Answer / b.mamatha

A virtual function or virtual method is a function or method
whose behaviour can be overridden within an inheriting class
by a function with the same signature. This concept is a
very important part of the polymorphism portion of
object-oriented programming (OOP).

Is This Answer Correct ?    2 Yes 0 No

what is virtual function?..

Answer / diwakar saraswat

virtual function is a member function of the class.
virtual function declare with virtual keyword.
once virtual function declare in base class, we can define
this function in drive class.

Is This Answer Correct ?    1 Yes 0 No

what is virtual function?..

Answer / bhupendra more

A function qualified by the virtual keyword. When a virtual
is called via a pointer,the class of the object pointed to
determine which function definition will be used. Virtual
function implement polymorphism. whereby objects belonging
to different classes can respond to the same massage in
different way.

Is This Answer Correct ?    1 Yes 0 No

what is virtual function?..

Answer / vindhyachal kumar gupta

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 ?    0 Yes 0 No

what is virtual function?..

Answer / ann

A virtual function is a function which is preceded by the
keyword 'virtual' followed by its normal declaration.When we
use the same function name in both the base and derived
classes,the function in base class is declared as virtual.
This concept is a very important part of the
polymorphism portion of object-oriented programming

Is This Answer Correct ?    0 Yes 0 No

what is virtual function?..

Answer / chandan jena

To make a class polymorphic we use virtual function.It
provides runtime polymorphism.

Is This Answer Correct ?    0 Yes 0 No

what is virtual function?..

Answer / dev malhotra

virtual function is defined as virtual is a keyword which is used when one function or method is used in both base class and drived class at a time then, during compile time compiler cannot distinguish that which one compile or run first.
then to distinguish that problem the programmer use special keyword in base class or in derived class that is known as "VIRTUAL" keyword.
Due to this keyword the compiler always compiles the assigned virtual keyword method or function and this is called as virtual function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is a class and object?

0 Answers  


Give two or more real cenario of virtual function and vertual object

0 Answers   TCS,


what is difference between c++ language and java language

5 Answers  


What is the point of polymorphism?

0 Answers  


What is polymorphism ? Explain with examples

8 Answers   Ness Technologies,


Does c++ support multilevel and multiple inheritance?

9 Answers   IBS, Wipro,


what is the realstic modeling?

1 Answers  


why we are declare the function in the abstract class even though we are declaring it in Derived class?

1 Answers   TCS,


sir plz send me a set of questions that been frequently held in written examination during campus selection.

0 Answers   TCS,


What is sub classing in c++?

1 Answers  


Which is the parameter that is added to every non-static member function when it is called?

3 Answers   Accenture,


What do you mean by Encapsulation?

0 Answers   Ittiam Systems,


Categories