Facts About Static Classes

1. Static class can have only static member, no instance member is allowed.
2. It can have only static parameterless constructor without access modifier so no constructor overloading is allowed.
3. Can'nt create object of the static class.
4. Static class is a sealed class by default so you can'nt drive class from the static class.
5. Any derived class can'nt be declared as static so static classes can'nt participate in the inheritance.
6. Static class can'nt have destructor.
7. It can have static events.
8. Static members can'nt be marked as abstract, virtual or override.
9. Make the static member public to access them using class name otherwise in case of private, protected or internal access modifier, they can'nt be accessed.
10. Static member of the abstract class can be accessed using the name of the derived class.

No comments: