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  How do I create a new instance of a class in Python?

Leave a Reply

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