How would you implement inheritance using VB.NET/C#?
Answer Posted / mr vinod kumar
When we set out to implement a class using inheritance, we must first start with an existing class from which we will derive our new subclass. This existing class, or base class, may be part of the .NET system class library framework, it may be part of some other application or .NET assembly, or we may create it as part of our existing application. Once we have a base class, we can then implement one or more subclasses based on that base class. Each of our subclasses will automatically have all of the methods, properties, and events of that base class ? including the implementation behind each method, property, and event. Our subclass can add new methods, properties, and events of its own - extending the original interface with new functionality. Additionally, a subclass can replace the methods and properties of the base class with its own new implementation - effectively overriding the original behavior and replacing it with new behaviors. Essentially inheritance is a way of merging functionality from an existing class into our new subclass. Inheritance also defines rules for how these methods, properties, and events can be merged. In VB.NET we can use implements keyword for inheritance, while in C# we can use the sign ( :: ) between subclass and baseclass.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How would you implement inheritance using c#?
What is Web Server Control Templates.?
How many types of file extensions for razor views in ASP.Net MVC?
Explain the steps needed to be performed in order to create an animation in xaml?
Explain file-based dependency and key-based dependency.
What is webresource axd?
Can you explain the importance of finalize method in .net?
What is the difference between executescalar and executenonquery?
Is asp.net still used?
What are session state modes?
Can you explain architecture of your project ?
In how many ways we can retrieve table records count?
if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....
What are server activated objects?
Explain the difference between dataset and datareader.