Where to use static constructor and static class

  • Thread starter Thread starter Ashok kumar
  • Start date Start date
A

Ashok kumar

dear friends
Can you tell me in which scenario we have to use static class and
static constructor?

Thanks in advance
 
Ashok said:
dear friends
Can you tell me in which scenario we have to use static class and
static constructor?

Use a static class when you want to implement functionality that does
not require per-instance state (i.e. all consumers of the class can
share the state).

Use a static constructor when you need to initialize state in a class
that is shared by all consumers of the class.

Pete
 
Back
Top