0
Why am i not understanding loop in java loan calculator?
3 odpowiedzi
+ 4
Ok, just imagine you have like
```kt
print("hello")
```
Which prints 1 times but...
What if you want to print it 50 times then here's loops job
```kt
var r = 1..50 //range
for(x in r) print("hello")
/**Int range are collection so it would print hello while it iterrate to the last */
```
Or
```kt
var r = 1
do {
r++
print("hello")
}while( r < 51 )
```
So loops are just method which returns command repeatedly based on the size of an array, list or collection
good luck
;)