About 197,000 results
Open links in new tab
  1. How can I get the size of an array, a Collection, or a String in Java ...

    May 19, 2014 · As an example, to get the length of a declared one-dimensional array, one would write this: double[] testScores = new double[] {100.0, 97.3, 88.3, 79.9}; …

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

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

    Notice that I actually have to reference a particular row, in order to get the column length. To me, this seems incredibly ugly. Additionally, if the array was defined as: test = new int[0][10]; Then …

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

    Feb 1, 2011 · In Java, we declare a String of arrays (eg. car) as. String []car; String car[]; We create the array using new operator and by specifying its type:-String []car=new String[]; String …

  5. java - Length of byte [] array - Stack Overflow

    Mar 12, 2014 · Array Members: The members of an array type are all of the following: The public final field length, which contains the number of components of the array. length may be …

  6. Finding the size of a char array in Java - Stack Overflow

    Jul 30, 2012 · The above answers work. Also, if for some reason you need to know the array size before you actually create the array (for pre-processing or some such activity), you can get the …

  7. Multidimensional Arrays lengths in Java - Stack Overflow

    May 11, 2011 · In java we can define array of arrays which we call multi dimensional arrays.By array of arrays we mean that a single elment of our array is again an array (in java can be of …

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

    Expansion for multi-dimension array total length, Generally for your case, since the shape of the 2D array is "squared". int length = nir.length * nir[0].length; However, for 2D array, each row …

  9. Finding length of all arrays multidimensional array, Java

    I would like to use a multidimensional array to store a grid of data. However, I have not found a simple way to find the length of the 2nd part of the array. For example: boolean[][] array = new …

  10. How do you count the elements of an array in java

    Dec 9, 2014 · The List is implemented on top of an array which gets resized whenever the JVM decides it's not big enough (or sometimes when it is too big). To get the count, you use …

Refresh