I am using C#. I have created a class which can be included in any c#.net project (desktop or web based), but I want that only 10 objects will be created in that application
I would create a static integer and update it when you instantiate a new object.
class YourClass { static int Count = 0; public YourClass() { Count++; if(Count > 10) { //throw exception } } }