|
String is for simple string operations while StringBuilder is used to perform high manipulation stri....
|
|
|
No, we can have only methods, properties, indexers and enums inside the interface.
|
Category:
C#
|
Date:
7/3/2010 1:54:37 PM
|
|
|
|
Static class we define when we do not want to create a object of class, all methods of static class ....
|
Category:
C#
|
Date:
7/3/2010 1:54:06 PM
|
|
|
|
Having same name methods with different parameters is called overloading, while having same name and....
|
|
|
Monitor.Enter waits for the lock until it does not get it, while Monitor.TryEnter will request for l....
|
|
|
|
Question:
451
Page Views:
|
How would you implement inheritance using VB.NET/C#?
|
|
Posted By:
Avi
|
Date:
5 February 2010 01:49:08 PM
|
|
|
Answer:
|
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. |
Posted By: eTechPlanet |
Date: 5 February 2010 01:49:08 PM | By using inherits keyword v can implement inheritance
and only single level, multiple level, and hybrid inheritance is supported in vb.net. |
Posted By: Johndecruse |
Date: 17 February 2010 02:23:56 AM |
|
|
|
|
Post a better Answer if you have
|
|