GameObject[,] gameObjects = new GameObject[3, 3]; int upperBound = gameObjects.GetUpperBound(0); Console.WriteLine("Upper bound of the first dimension is: " + upperBound);
GameObject[,,] gameObjects = new GameObject[2, 3, 4]; int upperBound = gameObjects.GetUpperBound(2); Console.WriteLine("Upper bound of the third dimension is: " + upperBound);In this example, we create a 3D array of size 2x3x4 using the GameObject class. We then pass the value 2 to the GetUpperBound method, which returns the upper bound of the third dimension of the array. We output this value to the console. These examples are part of the System namespace in the .NET package library.