In java we can write infinite loop using both while and for
for(;;){
// doesn't stop[infinite loop]
}
and using while
while(true){
// doesn't stop[infinite loop]
}
the syntax for kotlin's while loop for creating infinite loop is the same.
How do I create an infinite loop using for loop just like the example I wrote above(equivalent code) using kotlin.
Thank you!
while(true)?while (true)is readable that is even used in pseudo codes, I don't think any confusing syntax is better.while (true)is ugly and I'm used to programming language with a more elegant form of the endless loop.while(true)in any of the languages I’ve learned.