First of all I want to ask dat,is it a valid keyword. I have read it from MSDN help.
NotOverridable means that if we declare a method in base class with keyword NotOverridable , we cannot override that nethod in derived class.
But when I m declaring a method in base class as NotOverridable , I m getting the error, Check the code below--
Public Class base
Public NotOverridable Sub test()
Console.WriteLi ne("soia")
End Sub
End Class
Sub main()
Dim obj As New base
obj.test()
Console.ReadLin e()
End Sub
ERROr-
'NotOverridable ' cannot be specified for methods that do not override another method.
NotOverridable means that if we declare a method in base class with keyword NotOverridable , we cannot override that nethod in derived class.
But when I m declaring a method in base class as NotOverridable , I m getting the error, Check the code below--
Public Class base
Public NotOverridable Sub test()
Console.WriteLi ne("soia")
End Sub
End Class
Sub main()
Dim obj As New base
obj.test()
Console.ReadLin e()
End Sub
ERROr-
'NotOverridable ' cannot be specified for methods that do not override another method.
Comment