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
What is the file through which you can customize your asp.net application?
What is server redirect?
What is session id in web application?
What are the steps to follow to host a web application on a web server?
Any disadvantages in Dataset and in reflection ?
Describe the difference between inline and code behind - which is best in?
When Cookies are expired in ASP.NET?
Can we override the enablepartialrendering property of the scriptmanager class?
Can you explain architecture of your project ?
Explain the namespace classes used in asp.net mvc? : asp.net mvc
Explain the basic functionality of garbage collector?
What does it mean your session has timed out?
What is a server cookie?
What are the versions of garbage collection?
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?