Home  |  Contact us    
Abstract, Sealed & Static modifiers in C#


Explain Abstract, Sealed, and Static Modifiers in C#.

C# provides many modifiers for use with types and type members. Of these, three can be used with classes: abstract, sealed and static.

abstract
Indicates that a class is to be used only as a base class for other classes. This means that you cannot create an instance of the class directly. Any class derived from it must implement all of its abstract methods and accessors. Despite its name, an abstract class can possess non-abstract methods and properties.

sealed
Specifies that a class cannot be inherited (used as a base class). Note that .NET does not permit a class to be both abstract and sealed.

static
Specifies that a class contains only static members (.NET 2.0).




Category: OOPS Faqs Concepts Faqs, Interview Questions & Answers in C#



Ask New Questions
Microsoft.Net Framework
.Net 2.0 Namespaces
.Net Assemblies
OOPS Faqs in C#
ASP.Net Faqs
ASP.Net 2.0 Faqs
Web Services Faqs
ADO.Net Faqs
Database Faqs
OOPS Faqs
IT Project Management