Friday, March 27, 2009

What is the difference between sealed class and dynamic classes

Question :What is the difference between sealed class and dynamic classes?
Answer :Classes are sealed by default, i.e. properties cannot be added dynamically at runtime.
1) Dynamic classes can add additional dynamic properties at runtime; sealed classes cannot.
2) Sealed classes conserve memory because no internal hash table is needed to store dynamic
properties, and the compiler can provide better error feedback.

No comments: