Wednesday, June 29, 2016

Static class

Static class

Below are some important point to consider for static classes.
  • Contains only static member (properties also)
  • Can not be instantiated
  • Static class is sealed
  • Can not contain Instance constructor (can contain static constructior)
* Instance constructor used to create & initialize any instance member when we use new to create object hence static class can not have  Instance constructor.

* Difference between sealed and static class is instance creation (sealed can contain static as well as non static)

No comments:

Post a Comment