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
List all templates of the repeater control.
What are the ways of preserving data on a Web Form in ASP.NET?
What is session and cookies in asp.net?
What do you mean by serialize?
How can we secure the data which is send from client side to server? Like the login id and paasword needs to be authenticated on the server but we cannot send it in plain text into the server.One more thing we are not using the SSL here.
Explain some of the major built-in objects in asp.net
How do you declare static variable? What is its lifetime?
Which is better viewstate or session?
Explain the significance of routing? : asp.net mvc
Can we use MSSql as backend in asp.net...if yes then How.?
Explain how can we access static variable?
What is application session?
Can you explain page lifecycle in net?
What is the purpose of using MVC programming pattern in ASP.NET?
What is the use of response redirect in asp.net?