Lets say we have an 1d array called array. Now I know array.length gives me how many primitive types or objects are in a 1d array but what does it do for a 2d array with rows with different rows?
{1, 2, 3, 4}
array.length would be 4
but if its like
{1, 2, 3, 4}
{5, 6, 7}
{8, 9, 10, 11, 12}
what does the array.length return? I tried making a 2d array with uneven rows
public static void masin()
{
// declare and construct a 2D array
int[][] uneven =
{ { 1, 9, 4, 3, 32 },
{ 0, 2},
{ 0, 1, 2, 3, 4 } };
System.out.println( uneven.length );
}
but all terminal gave me was 3 no matter how I changed the array.