About Virtual functions and their use ?
Answer Posted / belson gnana pradeep
Virtual methods those can be overridden and replaced by sub classes.
When working with virtual methods keep in mind datatype of
an object is used to determine the implementation of
the method to call, rather than the type of the variable
that refers to an object.
In C#, a base class must provide the "virtual" modifier for
any virtual method, and derived classes must provide the
"override" modifier for any overriden method inherited from
a base class.
In VB.NET, a base class must provide the "Overridable"
modifier for any virtual method, and derived classes may
provide the optional "Overrides" modifier for any overriden
method inherited from a base class
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Can we have multiple constructors in a class c#?
What is sorting in c#?
How do I unload an assembly?
What is xpath in c#?
Explain the 3 types of properties in c# with an example?
What is thread pooling?
What is default constructor c#?
Are tuples immutable c#?
Is multilevel inheritance possible in c#?
What is use of hashtable in c#?
Why singleton class is sealed?
What is dbcontext c#?
What is Dependency of Injection?
What is lock statement in C#?
What is the difference between int and int in c#?