About 7,300,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 …

  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 make an array of arrays in Java - Stack Overflow

    Jul 23, 2017 · How to make an array of arrays in Java Asked 14 years, 9 months ago Modified 8 years, 3 months ago Viewed 476k times

  4. Java, Shifting Elements in an Array - Stack Overflow

    I have an array of objects in Java, and I am trying to pull one element to the top and shift the rest down by one. Assume I have an array of size 10, and I am trying to pull the fifth element. The...

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

  6. How do I determine whether an array contains a particular value in …

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

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

    May 16, 2010 · If you insist on using arrays, you can use java.util.Arrays.copyOf to allocate a bigger array to accomodate the additional element. This is really not the best solution, though.

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

    614 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: int[] newArray = …

  9. java - How to put a Scanner input into an array... for example a …

    May 8, 2010 · How to put a Scanner input into an array... for example a couple of numbers Asked 15 years, 5 months ago Modified 3 years, 6 months ago Viewed 483k times

  10. Convert list to array in Java - Stack Overflow

    There are two styles to convert a collection to an array: either using a pre-sized array (like c.toArray (new String [c.size ()])) or using an empty array (like c.toArray (new String [0]). In …