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
What are scriptable objects?
What does namespace mean?
Explain the access modifiers in c#?
What is the difference between add and addrange in c#?
Can hashtable have duplicate keys?
What is static classes?
Which of these string definitions will prevent escaping on backslashes in c#?
Can dictionary have duplicate keys c#?
What is a satellite assembly in c#?
Describe an abstract class?
How do I do a case-insensitive string comparison?
Is constructor a static method?
If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?
What is the purpose of reserved word using in c#?
What is an escape sequence? Name some string escape sequences in c#.