4
Reply

Is it possible to restrict object creation?

Mukesh Kumar

Mukesh Kumar

7y
379
0
Reply

    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, By throwing error

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