Here is the Test Answers of oDesk Programming With C#. We hope this test answers will help you to give the correct answers while you will be in the oDesk exam and pass with great score.
You need to keep track of how many objects of a given class exist by introducing a class member variable. Which one of the following solutions allows for this behavior?
- Add an automatic member variable that gets incremented in the default constructor and decremented in the destructor
- Add an automatic local variable that gets incremented in each constructor and decremented in the destructor
- Add a static member variable that gets incremented in each constructor and decremented in the destructor
- Add a register member variable that gets incremented in each constructor and decremented in each destructor
- This cannot be accomplished since the creation of objects is done dynamically via ‘new.’