4
Reply

Is it possible to restrict object creation?

Mukesh Kumar

Mukesh Kumar

7y
1.6k
1
Reply

    make your constructor private which is known as singleton pattern. Where there will be only one object created by developer.

    make your constructor private which is known as singleton pattern. Where there will be only one object created by developer.

    Yes By throwing error in constructer

    Yes