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
Can you explain the basic use of dataview?
How would you get asp.net running in apache web servers? Explain it's limitations.
What is app_code folder in asp net?
Should I delete cookies?
Who creates jsessionid?
What does asax stand for?
How asp.net mvc differs from asp.net web forms? : asp.net mvc
What is query string?
What is a Cookie? Where is it used in ASP.NET?
If you are using components in your application, how can you handle exceptions raised in a component?
Where the assembly is stored in asp.net?
How do I open an ashx file?
Give a few examples of page life cycle events.
What is the advantage of using Windows authentication in a Web application?
What is the difference between session object and application object?