In this tutorial, you shall learn about Arrays in Kotlin programming language, the basics of arrays and array operations, with examples.

Kotlin Array

Kotlin Array is an ordered collection of similar type of values.

An array in Kotlin is of fixed size. Once an array is declared of specific size, the size cannot be changed. In other words, we cannot add elements to the array, nor delete elements from the array.

The value of an element can be modified/updated.

In Kotlin, arrays are implemented via Array class.

Kotlin Array Tutorials

Before we dive into the basics of an Array in Kotlin, following are the list of tutorials that cover different concepts of Arrays in Kotlin.

Basics

Checks

Array Loops

Sorting

Replace

  • Kotlin – Replace Specific Element

Conclusion

In this Kotlin Tutorial, we learned about an Array in Kotlin. We learned how to create an Array with elements of specific data type; access its elements using index or set(), get() functions; iterate over the elements of Array using for loop.