Sunday, March 27, 2005
Cutting the Chain Of overriding
let's see how to Override a method in VB.NET
Public Overridable Sub Test()
Public Overrides SubTest()
Public Overrides Sub Test()
so can we cut the chain of permission for overriding the Test() method in Child ( i no more need anyone to be able to Override this method, my behaviour is the ultimate so i need to stop permitting my childs to override me )
we can do this in VB.NET by using NotOverridable so class child can be written like this :
Public NotOverridable Overrides SubTest()
so now we get a compilation error in MoreChild . but how can we do this in C# ?
unfortunately it cant be done ............. this is another VB vs C# competetion features ...