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

What is the file through which you can customize your asp.net application?

550


What is server redirect?

551


What is session id in web application?

497


What are the steps to follow to host a web application on a web server?

591


Any disadvantages in Dataset and in reflection ?

2829






Describe the difference between inline and code behind - which is best in?

515


When Cookies are expired in ASP.NET?

579


Can we override the enablepartialrendering property of the scriptmanager class?

646


Can you explain architecture of your project ?

619


Explain the namespace classes used in asp.net mvc? : asp.net mvc

501


Explain the basic functionality of garbage collector?

532


What does it mean your session has timed out?

533


What is a server cookie?

502


What are the versions of garbage collection?

1460


can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?

1755