Thursday, December 23, 2004

Static Classes in C# 2.0 and Abstract and Sealed Pattern

C# 2.0 introduces the static keyword at the class level. If you apply the static keyword to a type, then you cannot declare a variable of the type because it is marked as a static class. You also cannot derive from the type, or add any non-static members to the class. So a static class does the same as we apply the abstract and sealed pattern discussed in the last post.