dcsimg
Creating a Penta Instance Class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Harmeet_Chahal
Posted On:   Tuesday, April 1, 2003 01:35 AM

Suppose we have a 3 classes A,B,C. How can we restrict creation of instance of class a not more than 5 times by both the classes.Note we first create instance from class b by--- a o1= new a(); and similarly in class c.Now we run class b first and then run class c both.How can we restict the intances of class a to be made by both the classes not more than 5 times?

Re: Creating a Penta Instance Class

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, April 1, 2003 06:36 AM

You could keep a static class instance counter, and increment it in the constructor?

About | Sitemap | Contact