Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java add two arrays together

Object[] arrThree = new Object[arrTwo.length + arrOne.length];
int index = arrTwo.length;

for (int i = 0; i < arrTwo.length; i++) {
    arrThree[i] = arrTwo[i];
}
for (int i = 0; i < arrOne.length; i++) {
    arrThree[i + index] = arrOne[i];    
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #add #arrays
ADD COMMENT
Topic
Name
3+5 =