Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi frends,

normal method we can not declared as sealed method.

only overdide or overridable only we can make as sealed method.

but how we do normal method as sealed.

Thanks in advance.
Posted

1 solution

You can't "seal" a method in C# at all - you use sealed with classes to stop them being extended or being inherited from.

If you don't want code outside your class to be able to call a method within it, just declare it as private (or protected if you want derived classes to be able to access it)
 
Share this answer
 
Comments
rajacsharp5 10-Dec-13 6:06am    
thanks for revert.
got it.
the thing is im looking weather an anternate is available.
OriginalGriff 10-Dec-13 6:18am    
An alternate to what?
What are you trying to do / prevent?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900