InterviewSolution
Saved Bookmarks
| 1. |
Explain scope functions in the context of Kotlin. What are the different types of Scope functions available in Kotlin? |
|
Answer» The Kotlin standard library includes numerous FUNCTIONS that aid in the execution of a block of code within the context of an object. When you use a lambda expression to call these functions on an object, temporary scope is created. These functions are referred to as Scope functions. The object of these functions can be accessed WITHOUT knowing its NAME. Scope functions make code more clear, LEGIBLE, and succinct, which are key qualities of the Kotlin programming language. Following are the different types of Scope functions available in Kotlin:-
|
|