Which two changes should you make to the code?

You have the following class definition.

You discover that when you execute the following code, the SpawnTasks method enters an infinite loop.

You need to prevent the SpawnTasks method from entering an infinite loop.
Which two changes should you make to the code? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point
A. Add a property to the ProcessManagement class. Modify the property to allow only positive values to be stored in the DegreeOfParallelism member variable
B. Add a property to the ProcessManagement class. Modify the property to allow only positive values to be stored in the NumberOfTasks member variable.
C. Change the accessor of the ProcessManagement class to internal.
D. Change the accessor of the DegreeOfParallelism member variable to private.
E. Change the accessor of the SpawnTasks method to private.

microsoft-exams

4 thoughts on “Which two changes should you make to the code?

      1. I guess “A and D” should be correct.
        The user has to access the new property created in A, together with no more _direct_ access on “DegreeOfParallelism” in D.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.