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 do constructors do in c#?

904


Why hashtable is thread safe in c#?

961


windows c# using datagridview in edit form sql server

4047


How will you allow a class to be inherited, but prevent the method from being over-ridden?

961


Does hashset allow duplicates c#?

941


What is the difference between Java and .NET garbage collectors?

991


What is method overriding in c#

1051


What is a deadlock lock?

896


What is the difference between dataset and datatable in c#?

981


Enlist the different types of classes in c#?

898


What do you mean by jagged arrays in c#?

858


What is difference between managed and unmanaged code?

957


What is the difference between icomparer and icomparable in c#?

895


What is the default value of singleordefault?

901


What are the 4 pillars of any object oriented programming language?

841