Intermediate
C#
Q41 / 100
What is a Task in C# and how does it differ from void async methods?
Correct! Well done.
Incorrect.
The correct answer is A) Task-returning async methods can be awaited and observed for exceptions; async void is fire-and-forget and unobservable
A
Correct Answer
Task-returning async methods can be awaited and observed for exceptions; async void is fire-and-forget and unobservable
Explanation
async void exceptions crash the application unhandled. async Task is awaitable and its exceptions can be caught. async void is only acceptable for event handlers.
Progress
41/100