How should you complete the code segment?

DRAG DROP
You are developing a Windows Store app. The GetData() method returns an integer.
You need to run the method as an asynchronous task.
How should you complete the code segment? (To answer, drag the appropriate expression to the
correct position in the answer area. Each expression may be used once, more than once, or not at
all. You may need to drag the split bar between panes or scroll to view content.)

DRAG DROP
You are developing a Windows Store app. The GetData() method returns an integer.
You need to run the method as an asynchronous task.
How should you complete the code segment? (To answer, drag the appropriate expression to the
correct position in the answer area. Each expression may be used once, more than once, or not at
all. You may need to drag the split bar between panes or scroll to view content.)

Answer: See the explanation.

Explanation:
Box 1:

Box 2:



Leave a Reply 3

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


rubenm

rubenm

var t = Task.Factory.StartNew(() => GetData());
var t = Task.Factory.StartNew(() => GetData());

Two options work!

rubenm

rubenm

*mistake

var t = Task.Factory.StartNew(() => GetData());
var t = Task.Factory.StartNew(() => GetData());

rubenm

rubenm

i cant write the first option box…jaja, well, two options work, with casting and without