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

List down the sequence of methods called during the page load.

738


How do you secure your connection string information?

741


What r the asp.net list controls and difference between them?

763


What are the disadvantages of using session?

746


What is the difference between CC and BCC?

830


To display data in the combo box, prior to setting the Data Source, what kind of property on a Combo Box do you set with a column name?

843


What is the latest version of asp.net?

771


What are the memory-mapped files?

775


How to improve performance of web application asp.net mvc? : Asp.Net MVC

766


What are the layouts of ASP.NET Pages?

827


What is data caching?

777


What is the use of placeholder control?

772


What is the benefit of WebAPI over WCF?

785


Describe Segmentation With Paging?

836


is gateway for sms continue connected for sending sms.how?

2074