What is the difference between static and private constructor in C#?

1. Static constructor is called before the first instance of class is created, wheras private constructor is called after the first instance of class is created . 2. Static constructor will be executed only once, whereas private constructor is executed everytime, whenever it is called.

Sizin İçin Seçtik  What is constructor what are its different types?

Leave a Reply

Your email address will not be published. Required fields are marked *