Can we create private constructor?

Yes, we can declare a constructor as private . If we declare a constructor as private we are not able to create an object of a class. We can use this private constructor in the Singleton Design Pattern.

Sizin İçin Seçtik  2060 Rtx kaç mh?

Leave a Reply

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