Link to home
Start Free TrialLog in
Avatar of honestman31
honestman31

asked on

PHP Exam Question ( multiple choice )

Hello experts , I found this Question in an exam ,
( multiple choice )
Please explain your ANSWER .
You need to keep an eye on the existing number of objects of a given class without introducing a non-class member variable. Which of the following makes this happen?

       a.       Add a member variable that gets incremented in the default constructor and decremented in the destructor  
       b.       Add a local variable that gets incremented in each constructor and decremented in the destructor
       c.       Add a static member variable that gets incremented in each constructor and decremented in the destructor
       d.       This cannot be accomplished since the creation of objects is being done dynamically via "new."  
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial