About 437,000 results
Open links in new tab
  1. arrays - length and length () in Java - Stack Overflow

    Dec 27, 2009 · In Java, an Array stores its length separately from the structure that actually holds the data. When you create an Array, you specify its length, and that becomes a defining …

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

    To get the number of columns, we need to access the first array and consider its length. In this case, we access [1, 1, 1, 1] and thus, the number of columns = 4.

  3. How can I get the size of an array, a Collection, or a String in Java?

    May 19, 2014 · An array is created by an array creation expression (§15.10) or an array initializer (§10.6). An array creation expression specifies the element type, the number of levels of …

  4. How to find integer array size in java - Stack Overflow

    Mar 2, 2015 · 1 Integer Array doesn't contain size () or length () method. Try the below code, it'll work. ArrayList contains size () method. String contains length (). Since you have used int …

  5. Multidimensional Arrays lengths in Java - Stack Overflow

    May 11, 2011 · 7 Java has "jagged" multidimensional arrays, which means that each "row" in your two-dimensional array can have a different number of components. If you can assume that …

  6. java - How to find the length of an array list? - Stack Overflow

    Mar 11, 2012 · I don't know how to find the length of an array list. I think you might need to use blank.length (); but I'm not sure. I made an array list ArrayList<String> myList = new …

  7. java - Length of an object array - Stack Overflow

    Nov 26, 2012 · Indeed, array length is not a method. But you still use that to determine the length of an array. Are you saying that myArray.length() works for String or int / Integer array? …

  8. java - How to get length of rows and columns in Two-Dimensional …

    Oct 13, 2013 · This image is what you call 2D array, as you can see, it's actually an array of arrays. nums.length will return the length of the blue array (which is the number of the rows). …

  9. java - How to find length of a string array? - Stack Overflow

    Feb 1, 2011 · 3 This won't work. You first have to initialize the array. So far, you only have a String [] reference, pointing to null. When you try to read the length member, what you actually …

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

    System.out.println(nir[0].length); would give you the length of your first array. Also worth noting is that you don't have to initialize a multi-dimensional array as you did, which means all the …