Control Flow
Branching and looping in Kotlin, where most constructs are expressions rather than statements: if, when with its exhaustiveness rules, for over ranges and iterables, and labeled jumps. Interviewers use this group to check that you have stopped reaching for switch and the ternary operator.
part ofKotlinoverview, primer and where to startread it →on this pageshowhide
explore
- if as an Expression5 questions
- when as an Expression5 questions
- when Exhaustiveness5 questions
- for/while & Ranges6 questions
- Labeled break & continue5 questions
- Returns at Labels5 questions
questions
page 2 of 2Beyond `return@label`, how are labels (`this@label`) used to disambiguate receivers in nested lambdas with receivers, and how does this relate to return labels?
level: seniorimportance: nice to knowfreq 25%
basics
~10 sThe same @label names that target return@label also qualify this@label. In nested blocks with receivers (like apply inside apply), this@outerLabel lets you reach an outer receiver instead of the innermost one.
showing 31–31 of 31