About 18,000,000 results
Open links in new tab
  1. 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 when they …

  2. Removing an element from an Array (Java) - Stack Overflow

    42 You can't remove an element from the basic Java array. Take a look at various Collections and ArrayList instead.

  3. How to initialize an array in Java? - Stack Overflow

    Dec 21, 2009 · 4 If you want to initialize an array in a constructor, you can't use those array initializer like.

  4. How do I determine whether an array contains a particular value in Java ...

    Jul 15, 2009 · How do I determine whether an array contains a particular value in Java? Asked 16 years, 5 months ago Modified 3 months ago Viewed 2.9m times

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

  6. Get only part of an Array in Java? - Stack Overflow

    The length of an array in Java is immutable. So, you need to copy the desired part into a new array. Use copyOfRange method from java.util.Arrays class:

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

    Sep 28, 2009 · If you have an array of one of those, you can find the min or max using Arrays.stream(). A comprehensive solution to the problem of reductions over primitive arrays is rather than implement …

  8. 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.

  9. Resize an Array while keeping current elements in Java?

    82 I have searched for a way to resize an array in Java, but I could not find ways of resizing the array while keeping the current elements. I found for example code like int[] newImage = new …

  10. How do I remove objects from an array in Java? - Stack Overflow

    Sep 22, 2008 · You can't resize an array in Java. I assume you don't want to just null the elements since that would be trivial. Do you want to shift the other elements to remove the gaps?