I tried to research it but didn't find an answer. I'm creating a data class and in that class I would like to create an array with a fixed size. I tried the following 3 options:
data class User (
val profilePics = arrayOf("a", "b", "c")
)
data class User (
val profilePics: Array<String>(3)
)
data class User (
val profilePics = arrayOfNulls<String>(3)
)
But none of them work. This does work however:
data class User (
val profilePics: Array<String>
)
How can I initialize a fixed-size strings array inside a data class