Connecting Tech Pros Worldwide Forums | Help | Site Map

use of selaed classes in c#

Newbie
 
Join Date: Jul 2007
Posts: 5
#1: Jul 24 '07
hi,

sealed modifier is used to prevent derivation from a class.

Any other reasons are there for making Class as sealed any memory related issues.

TRScheel's Avatar
Expert
 
Join Date: Apr 2007
Location: Iowa
Posts: 624
#2: Jul 24 '07

re: use of selaed classes in c#


Quote:

Originally Posted by suneethadotnet

hi,

sealed modifier is used to prevent derivation from a class.

Any other reasons are there for making Class as sealed any memory related issues.

Sealed classes allow for compiler optimizations that will help the program run faster, but its memory footprint will remain roughly the same.
Needs Regular Fix
 
Join Date: Jul 2006
Location: India,Hyderabad
Posts: 367
#3: Jul 25 '07

re: use of selaed classes in c#


Quote:

Originally Posted by suneethadotnet

hi,

sealed modifier is used to prevent derivation from a class.

Any other reasons are there for making Class as sealed any memory related issues.

Hello

A class is declared as sealed when ever it provides the complete functionality ,i.e there isno need to extend further
some times for security wise it can be used
Reply