Why is the API method declared with suspend?

  1. To cache data
  2. To run it twice
  3. So it can be called from a coroutine and run without blocking the main thread
  4. To make it private
Answer

C) So it can be called from a coroutine and run without blocking the main thread

Retrofit runs suspend functions off the main thread.

Computer Science MCQ · More Lab: Displaying Data from an API MCQs · Practise