Java Array Copy copyArray(String[] originalArray)

Here you can find the source of copyArray(String[] originalArray)

Description

Copy a string array.

License

Open Source License

Parameter

Parameter Description
originalArray a parameter

Return

new string array

Declaration

public static String[] copyArray(String[] originalArray) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from  w ww  . j a  va2 s .  c  o  m*/
     * Copy a string array.
     * 
     * @param originalArray
     * @return new string array
     */
    public static String[] copyArray(String[] originalArray) {
        String[] copyOf = new String[originalArray.length];
        System.arraycopy(originalArray, 0, copyOf, 0, originalArray.length);
        return copyOf;
    }
}

Related

  1. copyArray(Object source, Object dest, int count)
  2. copyArray(Object[] array)
  3. copyArray(Object[] array, int from, int to)
  4. copyArray(Object[] from, Object[] to)
  5. copyArray(String[] array)
  6. copyArray(T[] array)
  7. copyArray(T[] original)
  8. copyArray2(Object v, int len)
  9. copyArrayAddFirst(String[] arr, String add)