Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Construct an element with initial values.

Array(1, 2, 3)
res0: Array[Int] = Array(1, 2, 3)
new Array[String](3)
res1: Array[String] = Array(null, null, null)

Construct an array of given size with all zeros.

Array.fill(3){0}
res2: Array[Int] = Array(0, 0, 0)
new Array[Int](3)
res3: Array[Int] = Array(0, 0, 0)