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 asp.net is better than php?
What is ispostback method in asp.net? Why do we use that?
How do you do client-side validation in .net? How to disable validator control by client side javascript?
How does cookies work in asp net?
WSDL means?
How do I use response redirect?
What is the current version of asp.net?
What is _dopostback in asp net?
Explain one critical mapping?
What is use of <% %> in asp.net?
Will session work if cookies is disabled?
Which browsers support the xmlhttprequest object?
What is the difference between Classic ASP and ASP.Net?
Explain the difference between an exe and a dll?
Explain cookies with example.