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 asp.net is better than php?

971


What is ispostback method in asp.net? Why do we use that?

1212


How do you do client-side validation in .net? How to disable validator control by client side javascript?

1014


How does cookies work in asp net?

1063


WSDL means?

1132


How do I use response redirect?

973


What is the current version of asp.net?

1002


What is _dopostback in asp net?

955


Explain one critical mapping?

993


What is use of <% %> in asp.net?

1009


Will session work if cookies is disabled?

1011


Which browsers support the xmlhttprequest object?

1002


What is the difference between Classic ASP and ASP.Net?

1092


Explain the difference between an exe and a dll?

1000


Explain cookies with example.

999