SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

Advanced Concept C# Interview Questions

» Start this Course
(Practice similar questions for free)
Question:

What is a sealed method in C# and when would you use it?

Author: Lock Huynh



Answer:

A sealed method in C# is a method that cannot be overridden by derived classes. It is used in a class that inherits from a base class to prevent further overrides of a specific method that has already been overridden. You would use a sealed method to ensure the current implementation of the method is preserved and not altered in further subclasses, enhancing security and maintaining consistency in behavior.


0 / 5  (0 ratings)

1 answer(s) in total