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...

About Virtual functions and their use ?

Answer Posted / om shivaya namaha

Suppose we have 4 class

Class
Base (haveing method Display())
Class | Class
Parent1-------------------------------------------Parent2
(having method : Par1) (having method : Par2)
| |
-------------------------------------------------
|
Class Child( having Method :ch1)



as Parent1,Parent2 derived from the Base class the Method
Display will be inherited in both Parent Classes and the
Child class is inherited from parent1,parent2
so the Child class may contain Display(Base class Method)
method 2 time so it will create runtime problems to avoid
such problems we have to use Virtual Overide concepts


Class
Base (haveing method Virtual:Display())
Class | Class
Parent1-------------------------------------------Parent2
(having method : Par1) (having method : Par2)
Override : Display() Override : Display()
| |
-------------------------------------------------
|
Class Child( having Method :ch1)

then the Child class will contail only one Display method

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is thread safe in c#?

836


What is the difference between private and protected in c#?

885


Value Type and Reference Type Data type in C#?

912


Explain get and set accessor properties?

843


what is main function of alternate teamplate of datalist?

2237


What is an array of arrays called?

815


How many types of variables are there in c#?

909


Describe ways of cleaning up objects in c#.

839


What are the different types of constructors in c#?

1082


What is clr namespace?

929


What is the difference between double and decimal in c#?

879


How can you reference current thread of the method ?

905


Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?

963


What is a streamwriter in c#?

868


What is semaphore in c#?

881