Async and Await Query

Copper Contributor

Why the output is like this
123
XYZ
as per my understanding, it should print XYZ first, as I am not writing await in line no. 50

amanjainits_1-1645899078938.png

 

1 Reply

The method Test is not async, which means it will block the current thread while waiting. And since that method is invokes before any await, that is the same thread as the one that executes PrintData, which means Test is effectively blocking PrintData.