Saturday, September 6, 2008

Class Modifiers

abstract: An instance of the class cannot be created.Usually this means the class is intended to serve as a base class.

sealed: The class cannot serve as a base class for another class (it can't be derived from). A class cannot be both abstract and sealed.

internal: The class is only accessible from other classes in the same assembly. This is the default access for non-nested types. If no modifier is specified, the class has internal access.

new: Used only with nested classes. "New" indicates that the class hides an inherited member of the same name.

private: A nested class that can only be accessed inside the class in which it is defined.

public: Instances of this class are available to any class that wants to access it.

No comments: