Is it possible to restrict object creation?
Mukesh Kumar
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