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?

Answer Posted / nk

A virtual function is basically a like normal function but
we can override the function in the derived classes.
Now when we want to access like (fn)

Base * bptr = new Derived();
bptr->fn(); then function of the derived class will be
called only if the function is marked as virtual in the
base class.

i.e the virtual keywork tells to use the function of the
class to which it is pointing to and not to the Base class.
This is called runtime polymorphism.

Is This Answer Correct ?    24 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism used for?

1108


Why do we use class?

1146


How many human genes are polymorphic?

1108


what type of questions

2171


What is encapsulation with example?

1194


What is polymorphism programming?

1174


Can we create object of abstract class?

1147


Why do we need oop?

1272


What is this pointer in oop?

1124


class type to basic type conversion

2465


What is the example of polymorphism?

1206


How do you answer polymorphism?

1105


What is inheritance and how many types of inheritance?

1152


What is polymorphism explain?

1313


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2675