How to prevent your class from being inherited? You can use keyword 'sealed' in the class definition to prevent class from being inherited. How to allow class to be inherited, but prevent the method from being over-ridden? You can do so by declaring the class public and making the method sealed.
|