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
What is in a session cookie?
Write a code for sending an email from asp.net application.
What are resource file and how do we generate resource file?
How can we register exception filter from the action?
What is %20 in a url?
Define the term Scavenging in Caching?
What is meant by ispostback in asp net?
Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ?
What is the significance of ASP.NET routing?
Can the validation occurs in server-side or client-side? If the validation occurs why should we do?
Which Is Faster MVC or ASP.net ?
What is the difference between an htmlinputcheckbox control and an htmlinputradiobutton control?
Define globalization and localization.
What is application variable in asp.net?
Is redux flux?