How can you prevent a class from overriding in C# and Visual Basic?
Ask by Sumit Kesarwani
Updated 20 Sep 2020
You can prevent a class from overriding in C# by using the sealed keyword; whereas, the NotInheritable keyword is used to prevent a class from overriding in Visual Basic.