Enforce to create more than one object of the same type

S

Steve120

Guest
Is there a way to avoid the invocation of the same object multiple times?

For example, I have 3 classes: dog, cat and snake and every classes have 3 parameters IDNumber, age and sexe.

Those classes implements the interface Zoo.

Is there a way to avoid enforces the creation of more than one dog?

Continue reading...
 
Top