Below is the code which I have wriiten to check the number of instances created for an Class called as Employee.
Somehow the code does not gives the expected output. Iam used a method called as checkinstances to check the number of instances created for the Employee class .
If it is equal to 3 , I throwing an exception. Also Iam checking the number of intances created using the overridden method called CheckInstances in both Clone and in constructor.
Any help in is really appreciated.