0

How can I iterate For loop only one time in Kotlin ?

8th Oct 2020, 6:53 AM
kev_coding
kev_coding - avatar
3 ответов
+ 3
for (i in 0..0) {} // i is only 0 for one loop
11th Oct 2020, 7:04 AM
John Wells
John Wells - avatar
+ 3
Why do you even need a loop when you want to iterate only one time?
8th Oct 2020, 6:56 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
Yeah why do you want a loop for 1 iteration. Its not even a loop.
8th Oct 2020, 6:58 AM
Steve Sajeev
Steve Sajeev - avatar