OD
(Choose 1 answer)
A. Task 01:1
Thread 'Main'Task 01:2
B. Task 01:2
Thread 'Main'Task 01:1
C. Thread 'Main'Task 01:1
Task 01:2
D. Results are unpredictable
class Program {
for (int i = 1; i <= 2; i++) {
Console.WriteLine($"{message}:{i}");
Thread.Sleep(1000);
}
}
static void Main(){
Thread.CurrentThread.Name = "Main";
Task task01 = new Task(() => PrintNumber("Task 01"));
task01.Start();Console.WriteLine(S"Thread '{Thread.CurrentThread.Name}'"");
Console.ReadKey();
}
}
Which one of the following is the output of the above code?
static void PrintNumber(string message){
Exit 40