About 110,000 results
Open links in new tab
  1. How can I concatenate two arrays in Java? - Stack Overflow

    Sep 17, 2008 · The following slightly more complicated version works with both object and primitive arrays. It does this by using T instead of T[] as the argument type. It also makes it …

  2. java - Combine two integer arrays - Stack Overflow

    Oct 1, 2015 · 0 Task: Given two int arrays array1 and array2 of the same length, zip should return an array that's twice as long, in which the elements of array1 and array2 are interleaved. That …

  3. How to merge two arrays in JavaScript and de-duplicate items

    Oct 18, 2009 · var array3 = ["Vijendra","Singh","Shakya"]; The output array should have repeated words removed. How do I merge two arrays in JavaScript so that I get only the unique items …

  4. Using Java streams to merge a pair of `int` arrays

    Arrays.toString ( merged ): [10, 20, 30, 40, 50, 60, 70, 80] Is there a way to use Java streams to concatenate a pair of arrays of primitive int values rather than objects?

  5. In Java, how can I combine two JSON arrays of objects?

    I mean that I didn't want to make a Java Object for each object in the JSON array, i.e. I don't want to create MyObject myobj = new MyObject(name, car); for each object, then merge the arrays …

  6. java - Merge two arrays together - Stack Overflow

    May 24, 2013 · 2 Well, first of all, java arrays have fixed memory and size, so to concat two arrays you have to create a new one with the size of arrOne.length + arrTwo.length and just iterate …

  7. Merge two arrays and remove duplicates in Java - Stack Overflow

    Feb 5, 2017 · Here's another attempt that combines two stackoverflow q's, combining arrays and removing dupes. This one runs a good deal faster than my earlier attempt on two lists of a …

  8. How to merge 2D arrays in java? - Stack Overflow

    Jan 31, 2016 · Since we know that number of rows in each array is the same it means that new array will have same amount of rows. So we can start by making something like String[][] …

  9. java - How can I merge 2 arrays in 1 loop? - Stack Overflow

    Aug 16, 2018 · Sure you can, just use one index to access both arrays (end condition would be the max of both lengths) and if their length can be different check index < length for each array …

  10. java - How can I merge 2 arrays? - Stack Overflow

    Jan 26, 2015 · You can get a better running time by sorting the two arrays O (Nlog (N)) and then merging them in a single iteration as is done in merge sort, eliminating the duplicates in the …