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.
A, D
Answer should be A, D
If DegreeOfParallelism is private, how can user change its value? 🙁
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.