How do I restrict object creation not more than 3 in Java class?
Can you give me an idea of how I can to do it?
Instanciate your class via a factory (see design patterns) and limit it to 3 instances using a simple counter.