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
List down the sequence of methods called during the page load.
How do you secure your connection string information?
What r the asp.net list controls and difference between them?
What are the disadvantages of using session?
What is the difference between CC and BCC?
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?
What is the latest version of asp.net?
What are the memory-mapped files?
How to improve performance of web application asp.net mvc? : Asp.Net MVC
What are the layouts of ASP.NET Pages?
What is data caching?
What is the use of placeholder control?
What is the benefit of WebAPI over WCF?
Describe Segmentation With Paging?
is gateway for sms continue connected for sending sms.how?