Here you can find the source of cloneArray(final String[] inputArray)
Parameter | Description |
---|---|
inputArray | a parameter |
public static String[] cloneArray(final String[] inputArray)
//package com.java2s; /*/*from w ww . j av a2 s. com*/ * Copyright 2014-2016 Web Firm Framework * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * To make the clone copy of the given String array. This method is faster * than the clone method of String array. * * @param inputArray * @return the cloned array of the given string array. * @author WFF * @since 1.0.0 */ public static String[] cloneArray(final String[] inputArray) { final String[] array = new String[inputArray.length]; System.arraycopy(inputArray, 0, array, 0, inputArray.length); return array; } }