Posted on 10th September 2024| views
There is no inherited for loop within Kotlin unlike Java and additional languages. Within Kotlin, for loop is utilized to iterate over arrays, ranges, maps, etc., anything that gives an iterator.
Take a look at a simple example to understand the iteration process of elements through an array by utilizing the for loop in kotlin.
Ex:
Fun main(args : Array<String>)
{
Val percentage = arrayOf(50, 65, 70, 80, 85)
for(item in percentage)
{
println(item)
}
}