What is a sealed modifier in C# programming language?

 Posted by Goud.Kv on 9/1/2014 | Category: C# Interview questions | Views: 193 | Points: 40
Answer:

sealed modifiers are used to seal a class or a particular method to prevent inheriting them by the derived classes.

For class,
sealed class One // This is a sealed class

{
.......;
......;
}

This cannot be inherited by the deived classes,
class Two : One // This will give a compile time error

{
........;
......;
}


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response