sealed class contain a concrete methods.but it does not participate in inheritance why? once it use

Posted by Harieswer under C# on 8/12/2015 | Points: 10 | Views : 297 | Status : [Member] | Replies : 2
sealed class contain a concrete methods.but it does not participate in inheritance why?
once it used in inheritance ,it stop the inheritance why?




Responses

Posted by: Shreedar on: 8/15/2015 [Member] Starter | Points: 25

Up
0
Down
Hi

Why you are posting the same question many times.
If you don't get reply means please wait. But dont create duplicate posts.

Regards,
Sridhar Thota.

Regards

Sridhar Thota.
www.dotnet-sridhar.blogspot.com

Harieswer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajnilari2015 on: 9/28/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
It is because of design choice made by the .Net CLR team.
However, if a class is Sealed then .NET doesn’t need to consult the virtual-function-call table to find the actual type, since it knows that no derived type can exist. Therefore, it could emit a ‘call’ instead of ‘callvirt’ or at least optimise the machine code, thus producing a performance benefit.

--
Thanks & Regards,
RNA Team

Harieswer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response