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


Please Help Members By Posting Answers For Below Questions

Which is an advantage of application service providers?

680


How does viewstate work?

797


What is the main difference between Asp.net and Vb.net?

805


Difference between using directive vs using statement?

723


Define viewstate in .net?

731


What is the mvc model?

771


What methods are fired during the page load? Init()

737


What is the concept of postback in asp.net?

796


What is difference between abstract class and an interface?

725


What is redirectpermanent in asp.net?

826


Can you set which type of comparison you want to perform by the comparevalidator control?

711


If you are using two select queries and retrieving data. how do you access second query's result set using data reader?

5184


Explain About duration in caching technique

845


How can you register a custom server control to a web page?

760


how can create login from create and written conde in asp.net

1989