Multiple choice .net c-sharp

In order to lock/unlock an object use the.

  1. Lock and Unlock methods

  2. Enter and Exit methods

  3. Close and Open methods

  4. Close and Allow methods

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Monitor class uses Enter() to acquire a lock and Exit() to release it. In C#, you typically use the lock keyword which compiles to Monitor.Enter and Monitor.Exit. Lock/Unlock and Close/Open are not the correct method names for this purpose.