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
Which is an advantage of application service providers?
How does viewstate work?
What is the main difference between Asp.net and Vb.net?
Difference between using directive vs using statement?
Define viewstate in .net?
What is the mvc model?
What methods are fired during the page load? Init()
What is the concept of postback in asp.net?
What is difference between abstract class and an interface?
What is redirectpermanent in asp.net?
Can you set which type of comparison you want to perform by the comparevalidator control?
If you are using two select queries and retrieving data. how do you access second query's result set using data reader?
Explain About duration in caching technique
How can you register a custom server control to a web page?
how can create login from create and written conde in asp.net