D
D
Dred Wolf2021-03-19 11:47:16
Kotlin
Dred Wolf, 2021-03-19 11:47:16

How to declare an array in Kotlin without specifying its size and elements?

how to create a "dynamic" array of an indefinite number of elements in Kotlin, so that you can then use it in a loop filling with elements.

What construction will it be possible to fill in such an array, if it is impossible to access by indexes, as I understand it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2021-03-19
@DredWulf

No way. The length of an array is fixed and cannot change.
You can use List

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question