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 an interface extend a class c#?
What is the use of command builder?
What is the use of console readline () in c#?
If you want to write your own dot net language, what steps you will u take care?
Can we inherit abstract class in c#?
Enlist some of the properties of a thread class?
Why to use lock statement in c#?
Can we make a Static Constructor Parameterized? Give Reason with your answer
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
How many constructors can a class have in c#?
What are the advantages of clr procedure over t-sql procedure?
List down the different ide’s provided by microsoft for c# development.
What is literal control
Do extension methods have to be static?
Can you create an instance of a static class?