Logo

Programming-Idioms

History of Idiom 26 > diff from v72 to v73

Edit summary for version 73 by hover:
[Kotlin] add doc

Version 72

2020-04-23, 15:44:07

Version 73

2020-04-29, 10:34:45

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration
Code
val x = Array(m, { DoubleArray(n) })
Code
val x = Array(m, { DoubleArray(n) })
Comments bubble
The type of x is Array<DoubleArray>. In other words, an array of arrays.
Comments bubble
The type of x is Array<DoubleArray>. In other words, an array of arrays.
Doc URL
https://kotlinlang.org/docs/reference/basic-types.html#arrays