Here you can find the source of appendArray(Object[] array1, Object[] array2)
Parameter | Description |
---|---|
array1 | a parameter |
array2 | a parameter |
public static Object[] appendArray(Object[] array1, Object[] array2)
//package com.java2s; /******************************************************************************* * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w ww .j a v a2 s. c om*/ * IBM Corporation - initial API and implementation *******************************************************************************/ public class Main { /** * Appends array2 to the end of array1 and returns the result * * @param array1 * @param array2 * @return */ public static Object[] appendArray(Object[] array1, Object[] array2) { Object[] result = new Object[array1.length + array2.length]; System.arraycopy(array1, 0, result, 0, array1.length); System.arraycopy(array2, 0, result, array1.length, array2.length); return result; } }