About 170,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 · Java does not truely support multidimensional arrays. In Java, a two-dimensional array is simply an array of arrays, a three-dimensional array is an array of arrays of arrays, a …

  3. How do I copy a 2 Dimensional array in Java? - Stack Overflow

    Arrays in java are objects, and all objects are passed by reference. In order to really "copy" an array, instead of creating another name for an array, you have to go and create a new array …

  4. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · This answer fails to properly address the question: "How do I declare and initialize an array in Java?" Other answers here show that it is simple to initialize float and int arrays …

  5. how to create dynamic two dimensional array in java?

    Apr 25, 2010 · This will give you a two dimensional String array with 3 rows and 3 columns; Note that in Class<tType> c -> c cannot be primitive type like say, int or char or double.

  6. How to create an 2D ArrayList in java? - Stack Overflow

    Jun 6, 2013 · Hi. The title of the question is not consistent with its content. Do you want a 2D array of ArrayList (something like 3D, finally) or a 2D ArrayList (an ArrayList of ArrayList)? If …

  7. How do I do a deep copy of a 2d array in Java? - Stack Overflow

    Oct 14, 2009 · Yes, you should iterate over 2D boolean array in order to deep copy it. Also look at java.util.Arrays#copyOf methods if you are on Java 6. I would suggest the next code for Java 6:

  8. java - Convert a 2D array into a 1D array - Stack Overflow

    Jan 20, 2012 · I am a novice : ( How to convert a 2D array into a 1D array? The current 2D array I am working with is a 3x3. I am trying to find the mathematical mode of all the integers in the …

  9. java - Create a two dimensional string array anArray [2] [2] - Stack ...

    Dec 3, 2013 · Create a two dimensional string array anArray[2][2]. Assign values to the 2d array containing any Country and associated colour. Example: France Blue Ireland Green Output …

  10. How can I create a two dimensional array in JavaScript?

    Assuming a somewhat pedantic definition, it is technically impossible to create a 2d array in javascript. But you can create an array of arrays, which is tantamount to the same.