Question:You are writing a method that returns an ArrayList named al. You need to ensure that changes to the ArrayList are performed in a thread-safe manner. Which code segment should you use? 

A ArrayList al = gcnew ArrayList();
lock (al->SyncRoot.GetType())
{
return al;
}
"A Composite Solution With Just One Click" - Certification Guaranteed 280 Microsoft 70-536 Exam 

B ArrayList= al = gcnew ArrayList();
lock (al->SyncRoot)
{
return al; 
  } 

C ArrayList= al = gcnew ArrayList();
ArrayList= sync_al = ArrayList::Synchronized(al);
return sync_al; 

D ArrayList= al = gcnew ArrayList();
Monitor::Enter(al);
Monitor::Exit(al);
return al; 

+ Answer
+ Report
Total Preview: 660

Copyright © 2024. Powered by Intellect Software Ltd