About 4,580,000 results
Open links in new tab
  1. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · You can either use array declaration or array literal (but only when you declare and affect the variable right away, array literals cannot be used for re-assigning an array). For …

  2. Syntax for creating a two-dimensional array in Java

    8 In Java, a two-dimensional array can be declared as the same as a one-dimensional array. In a one-dimensional array you can write like

  3. How do I fill arrays in Java? - Stack Overflow

    Feb 23, 2009 · I know how to do it normally, but I could swear that you could fill out out like a[0] = {0,0,0,0}; How do you do it that way? I did try Google, but I didn't get anything helpful.

  4. How to make an array of arrays in Java - Stack Overflow

    Arrays are cumbersome, in most cases you are better off using the Collection API. With Collections, you can add and remove elements and there are specialized Collections for …

  5. java - Create ArrayList from array - Stack Overflow

    Oct 1, 2008 · If you look, Arrays ISN'T returning a true java.util.ArrayList. It's returning an inner class that implements the required methods, but you cannot change the memebers in the list.

  6. java - How to add new elements to an array? - Stack Overflow

    May 16, 2010 · The size of an array can't be modified. If you want a bigger array you have to instantiate a new one. A better solution would be to use an ArrayList which can grow as you …

  7. equals vs Arrays.equals in Java - Stack Overflow

    Jan 8, 2012 · When comparing arrays in Java, are there any differences between the following 2 statements? Object[] array1, array2; array1.equals(array2); Arrays.equals(array1, array2); And …

  8. arrays - length and length () in Java - Stack Overflow

    Feb 8, 2018 · 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 …

  9. Finding the max/min value in an array of primitives using Java

    Sep 28, 2009 · Pass the array to a method that sorts it with Arrays.sort() so it only sorts the array the method is using then sets min to array[0] and max to array[array.length-1].

  10. java - Make copy of an array - Stack Overflow

    Java Array Copy Methods Object.clone (): Object class provides clone () method and since array in java is also an Object, you can use this method to achieve full array copy.