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
Why does my asp.net file have multiple tag with runat=server?
Differences between “dataset” and “datareader”.
Where the cookie value is stored?
What is session and cookies in asp.net?
Securitywise What are the Enhancements in 2.0?
What is the difference between cache and cookies?
What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?
What kind of data can be stored in viewstate?
What is an axd file?
Which dll handles the request of .aspx page?
What is different in .net 1.1 and .net 2.0?
What is asp.net and its advantages?
Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?
Explain exception filters?
How you can access the properties and controls of master pages from content pages?