Equivalent of C#'s Array.GetUpperBound() in java : <p>I am trying to translate C#'s <code>GetUpperBound()</code> in java. Let's say we have a 2D array in java:</p>

<pre><code>int[][] array = new int[2][3] { {1, 2, 3}, {4, 5, 6} };
</code></pre>

<p>I understand that in C# <code>array.GetUpperBound(0)</code> would return <code>1</code> (the last index of the first dimension) and <code>array.GetUpperBound(1)</code> would return <code>2</code> (the last index of the second dimension).</p>

<p>How someone could implement this functionality in java? Is C#'s <code>array.GetUpperBound(0)</code> the same as Java's <code>array[0].length - 1</code> or <code>array.length - 1</code>?</p>
