Home »

Can you allow a class to be inherited, but prevent a method from being overridden in C#?

Question ListCategory: C#.NETCan you allow a class to be inherited, but prevent a method from being overridden in C#?
jessica537 author asked 8 years ago
1 Answers
alisataylore190 author answered 8 years ago

Yes. Just declare the class public and make the method sealed.

Please login or Register to Submit Answer