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
5 Comments on “Which code segment should you use?”
Najlepszy Programista Swiata DAGOsays:
C
1
0
Lord Vadersays:
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.
0
0
Lord Vadersays:
using await and no async – compiler error
using async wihtout an await – warning
0
0
Vassosays:
C
0
0
Giovannisays:
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
C
1
0
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.
0
0
using await and no async – compiler error
using async wihtout an await – warning
0
0
C
0
0
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
3
0