About 50 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 it by …

  2. 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 fill a …

  3. 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 for finding the …

  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. 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 as …

  7. java - How to insert values in two dimensional array programmatically ...

    May 25, 2012 · You can set values at specific array positions. If you know how to do it with one-dimensional arrays then you know how to do it with n-dimensional arrays: There are no n …

  8. How can I manipulate 2D arrays in Java? - Stack Overflow

    Oct 10, 2014 · 3 I've been studying for my upcoming Java exam, and i'm having a hard time wrapping my head around 2D arrays. I have the basics down, such as creating and initializing a 2D array, but …

  9. Sorting 2D array of strings in Java - Stack Overflow

    0 -Create list out of this array using Arrays.toList () -Design comparator using java.lang.comparator and write logic for sorting every even elements

  10. Find the dimensions of a 2D array in java - Stack Overflow

    Apr 10, 2016 · I'm playing around with Arrays in Java and had this doubt. How do I find the dimensions of a 2D array in java? For example, I get an array input from System.in and pass it in another method …