Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers
elance-zoho-creator-exam.pdf

public class Program { [ThreadStatic] public static int _field; public static void Main() { new Thread(() => { for (int x = 0; x < 5; x++) { _field++; Console.WriteLine(" Thread A: {0}", _field); } }).Start(); new Thread(() => { for (int x = 0; x < 5; x++) { _field++; Console.WriteLine(" Thread B: {0}", _field); } }).Start(); } } What will be the result of this code ?

Thread A: 1 Thread A: 2 Thread A: 3 Thread A: 4 Thread A: 5 Thread B: 1 Thread B: 2 Thread B: 3 Thread B: 4 Thread B: 5
Exception will be thrown
Thread A: 1 Thread A: 2 Thread A: 3 Thread A: 4 Thread A: 5 Thread B: 6 Thread B: 7 Thread B: 8 Thread B: 9 Thread B: 10
Top
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon