Scala Multidimensional ArrayMultidimensional array is an array which store data in matrix form. You can create from two dimensional to three, four and many more dimensional array according to your need. Below we have mentioned array syntax. Scala provides an ofDim method to create multidimensional array. Multidimensional Array SyntaxScala Multidimensional Array Example by using ofDimIn This example, we have created array by using ofDim method. Output: 0 0 15 0 Third Element = 0 Scala Multidimensional Array by using Array of ArrayApart from ofDim you can also create multidimensional array by using array of array. In this example, we have created multidimensional array by using array of array. Output: 1 2 3 4 5 6 7 8 9 10 Scala Addition of Two Matrix ExampleYou can manipulate array elements in scala. Here, we are adding two array elements and storing result into third array. Output: 2 4 6 8 10 12 14 16 18 20 Next TopicScala String |