About 811,000 results
Open links in new tab
  1. Syntax for creating a two-dimensional array in Java

    If you want to store n elements then the array index starts from zero and ends at n-1. Another way of creating a two dimensional array is by declaring the array first and then allotting memory for …

  2. Initialising a multidimensional array in Java - Stack Overflow

    Jul 1, 2009 · 9 Multidimensional Array in Java Returning a multidimensional array Java does not truely support multidimensional arrays. In Java, a two-dimensional array is simply an array of …

  3. The best way to print a Java 2D array? - Stack Overflow

    5 From Oracle Offical Java 8 Doc: public static String deepToString(Object[] a) Returns a string representation of the "deep contents" of the specified array. If the array contains other arrays …

  4. Getting the array length of a 2D array in Java - Stack Overflow

    Also, if you accept a 2D array as input, e.g. in a constructor. You should check it and throw exceptions where applicable.

  5. java Arrays.sort 2d array - Stack Overflow

    How can you pass 2D array as the argument when sort expects a 1D array? This didn't work for me.

  6. java - Which comes first in a 2D array, rows or columns ... - Stack ...

    Jul 25, 2012 · When creating a 2D array, how does one remember whether rows or columns are specified first?

  7. Arrays.fill with multidimensional array in Java - Stack Overflow

    Aug 19, 2011 · 4 Multidimensional arrays are just arrays of arrays and doesn't check the type of the array and the value you pass in (this responsibility is upon the developer). Thus you can't …

  8. Finding minimum and maximum in Java 2D array - Stack Overflow

    0 Your problem is: You are sorting the array of int arrays instead of sorting each individual int in each int array. To solve this: Loop through each int array in the array of int arrays. Instructions …

  9. java - Iterate through 2 dimensional array - Stack Overflow

    Sep 12, 2014 · I have a "connect four board" which I simulate with a 2d array (array [x] [y] x=x coordinate, y = y coordinate). I have to use "System.out.println", so I have to iterate through …

  10. java - Getting the length of two-dimensional array - Stack Overflow

    0 Expansion for multi-dimension array total length, Generally for your case, since the shape of the 2D array is "squared".