Quiz
This lesson challenges the reader on some of the concepts covered under asynchronous programming.
Question # 1
Consider the snippet below:
Press + to interact
async Task Wait(){await Task.Delay(1000);}async Task Wrapper(){await Wait();await Wait();}public void runTest(){Wrapper();}
Q
What is the outcome of running the runTest()
in the snippet above?
A)
The method waits for one second before executing
B)
The method waits for two seconds before executing
C)
The method doesn’t doesn’t block and exits because the Wrapper()
method is async
Press + to interact
using System;using System.Threading;using System.Threading.Tasks;class Demonstration{static async Task Wait(){await Task.Delay(1000);}static async Task Wrapper(){await Wait();await Wait();}static public void runTest(){Wrapper();}static void Main(){runTest();}}
Question # 2
...Access this course and 1400+ top-rated courses and projects.