About 11,900,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. Syntax for creating a two-dimensional array in Java

    2 Actually Java doesn't have multi-dimensional array in mathematical sense. What Java has is just array of arrays, an array where each element is also an array. That is why the absolute requirement to …

  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 different functionality (index …

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

    Jan 9, 2020 · 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 if so, …

  6. java - Arrays.asList () of an array - Stack Overflow

    Jul 28, 2015 · int[] factors = {1, 2, 3}; ArrayList<Integer> f = new ArrayList(Arrays.asList(factors)); System.out.println(f); } } At the println line this prints something like " [ [I@190d11]" which means that …

  7. How can I concatenate two arrays in Java? - Stack Overflow

    Sep 17, 2008 · The array created by Arrays.copyOf will have the component type of the first array, i.e. Integer in this example. When the function is about to copy the second array, an …

  8. How do you find the sum of all the numbers in an array in Java?

    Dec 29, 2010 · I'm having a problem finding the sum of all of the integers in an array in Java. I cannot find any useful method in the Math class for this.

  9. 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 attribute of the …

  10. How to convert an Array to a Set in Java - Stack Overflow

    I would like to convert an array to a Set in Java. There are some obvious ways of doing this (i.e. with a loop) but I would like something a bit neater, something like: java.util.Arrays.asList(Obj...