Array in kotlin

Опубликовано: 16 Октябрь 2024
на канале: Android Learners
50
1

Array in Kotlin.
.
Arrays are a collection of homogeneous data. Like Java, Kotlin supports arrays of different data types. In the following example, we will make use of different arrays.
fun main(args: Array (String) ) {
val numbers: IntArray = intArrayOf(1, 2, 3, 4, 5)
println("Hey!! I am array Example"+numbers[2])
}
The above piece of code yields the following output. The indexing of the array is similar to other programming languages. Here, we are searching for a second index, whose value is “3”.
.
.
.
Like my video
subscribe my channel
Don't forget to click on the bell icon .
.
.
.
music credit:
Filmora free music stock...
.
.
If you have any problem then comment below I will reply it as soon as possible.
.
.
#AndroidLearners