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

Can you explain what inheritance is and an example of when
you might use it?

Answer Posted / sandeep

In Inheritance we can use one class property into another
class..
using System;
class sample
{
public void display()
{
Console.WriteLine("C#");
}
}
class sample1:sample
//(Inheriting the property of class sample in class sample1)
{
public void disp()
{
Console.WriteLine("C++");
}
}
class Test
{
public static void Main()
{
sample1 sm=new sample1(); //creating a object of sample1
sm.display(); //accessing function of sample class
sm.disp();
}
i think dear u got ur write answer..

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does my asp.net file have multiple tag with runat=server?

931


Differences between “dataset” and “datareader”.

982


Where the cookie value is stored?

893


What is session and cookies in asp.net?

970


Securitywise What are the Enhancements in 2.0?

1880


What is the difference between cache and cookies?

953


What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?

1077


What kind of data can be stored in viewstate?

936


What is an axd file?

1021


Which dll handles the request of .aspx page?

922


What is different in .net 1.1 and .net 2.0?

964


What is asp.net and its advantages?

929


Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?

1040


Explain exception filters?

974


How you can access the properties and controls of master pages from content pages?

890