Initializing a jagged array, one in which the length of each array differs : Array Multi Dimension « Data Structure « VB.Net






Initializing a jagged array, one in which the length of each array differs

Initializing a jagged array, one in which the length of each array differs
 
Imports System
Imports System.Data
Imports System.Collections

public class MainClass
   Shared Sub Main()
        Dim c()() As Integer = {New Integer() {1, 2}, New Integer() {1, 2, 3}}

        c(1) = New Integer() {4, 5}
        Console.WriteLine(c(1)(1))
        c(1) = System.Array.CreateInstance(GetType(System.Int32), 10)
        Console.WriteLine(c(1)(1))
        Dim d() As Integer = {6, 7}
        c(1) = d
        Console.WriteLine(c(1)(1))
   End Sub
End Class


           
         
  








Related examples in the same category

1.Define and initialize the multi-dimensional arrayDefine and initialize the multi-dimensional array
2.Seclare a 4x3 Integer arraySeclare a 4x3 Integer array
3.Array Performance Test: Two-dimensional arrayArray Performance Test: Two-dimensional array
4.Array Performance Test: Two-dimensional Array and SetValue(i, i)Array Performance Test: Two-dimensional Array and SetValue(i, i)
5.Two Dimensional Rectangle ArrayTwo Dimensional Rectangle Array
6.Define and Init two dimensional arrayDefine and Init two dimensional array
7.Initializing multidimensional arrays: rectangular two-dimensional arrayInitializing multidimensional arrays: rectangular two-dimensional array
8.Jagged two-dimensional arrayJagged two-dimensional array
9.Two dimension array DemoTwo dimension array Demo
10.Array.SetValue for two-dimensional array
11.Array.SetValue for three-dimensional array
12.Array.SetValue for a seven-dimensional array
13.Clear multi-dimensional array