December 2019
Intermediate to advanced
346 pages
9h 8m
English
In the following code, we are creating a task object by calling the Task constructor and passing an anonymous delegate containing the method we want to execute:
Task task = new Task (delegate {PrintNumber10Times ();});task.Start();
In all of these cases, the output will be as follows:
All the preceding methods do the same thing – they just have different syntaxes.
Read now
Unlock full access