Monday, September 15, 2008

Total no. of instances

How will you find the total number of instances for a class?

Have a static variable and increment that variable in the constructor.
http://www.pp.rhul.ac.uk/~george/PH2150/html/node48.html

No comments: