Cass to Track Number of Instances

Design a class that will keep track of number of instances that have been instantiated. Make this class thread safe.

Questions by ayongying

Showing Answers 1 - 3 of 3 Answers

Dearsi

  • Feb 1st, 2012
 

Here

Code
  1. 1       public class Utility

  2. 2       {

  3. 3           public Utility()

  4. 4           {

  5. 5               InstanceCount++;

  6. 6           }

  7. 7        

  8. 8           public static int InstanceCount;

  9. 9       }

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions