A creational design pattern( singleton) is applied here so as to limit the instances and avoid getting bugs due to multiple instances. A class SingletonGovt is created which has a private object instance and is initialized. The constructor is making sure no more than one instance can be created.
A creational design pattern( singleton) is applied here so as to limit the instances and avoid getting bugs due to multiple instances. A class SingletonGovt is created which has a private object instance and is initialized. The constructor is making sure no more than one instance can be created.