Design a Class to Restrict Object Creation to 5 Instances
One interesting interview question that tests your understanding of object creation control is: Design a class such that only 5 objects can be created. If you try to create a 6th object, it should throw an error. In this blog…