Which code segment should you use?

You are developing an application that uses multiple asynchronous tasks to optimize performance.
You need to retrieve the result of an asynchronous task.
Which code segment should you use?

You are developing an application that uses multiple asynchronous tasks to optimize performance.
You need to retrieve the result of an asynchronous task.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Najlepszy Programista Swiata DAGO

Najlepszy Programista Swiata DAGO

C

Lord Vader

Lord Vader

has to b C.
the async keyword is a method modifier that enables the method to use the await keyword and enables a calling method to use this function using the await keyword.

Lord Vader

Lord Vader

using await and no async – compiler error
using async wihtout an await – warning

Giovanni

Giovanni

If you answer C, compiler rise a warning, but aslso suggest to remove async Task from GetData.
For me the right answer (that compiles as well) is A