Virtual Functions in VB.net

adwaitjoshi

Active member
Joined
Dec 29, 2005
Messages
38
Programming Experience
1-3
I am new to .net. As far as I know all the functions are virtual (by default) in VB .net. If I want a few functions not to be virtual, what do I need to do? Also do I need to specify "overrides" for a virtual function in VB .net ?
 
Yes, all methods in VB.Net are virtual and that is not something you have to worry about in general.
The concept of a virtual method is such that the “bottom-most” implementation of the method is always used in favor of the parent implementation – regardless of the data type of the variable being used in the client code.
You use the 'overrides' keyword for sub-classes that implement and override a parent class method (and never care if a method anywhere is virtual or not).
Look here to article about inheritance in VB.Net:
http://www.developerfusion.co.uk/show/1047/4/
 
Back
Top