    

 ## On this page

  

 

 # setSize

 Last update: 30.07.2026 

public [setSize](set-size.md)(size: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html))

sets the size of the array. Same as setLength()

#### Parameters

sizethe number of elements to store in the array#### Throws

[ModelCenterException](./../-model-center-exception/index.md)public [setSize](set-size.md)(size: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html), dimension: [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html))

sets the size of a specific dimension in the array. Same as setLength()

#### Parameters

sizethe number of elements to store in the arraydimensionthe dimension of interest (0-based index)#### Throws

[ModelCenterException](./../-model-center-exception/index.md)