Java Array Clone clone(String[] array)

Here you can find the source of clone(String[] array)

Description

Clones an array returning a typecast result and handling null.

License

Open Source License

Parameter

Parameter Description
array the array to clone, may be null

Return

the cloned array, null if null input

Declaration

private static String[] clone(String[] array) 

Method Source Code

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

public class Main {
    /**/*from  w w w.ja v  a 2 s  .  c  o  m*/
     * Clones an array returning a typecast result and handling null.
     * This method returns null for a null input array.
     *
     * @param array the array to clone, may be null
     * @return the cloned array, null if null input
     */
    private static String[] clone(String[] array) {
        if (array == null) {
            return null;
        }
        return array.clone();
    }
}

Related

  1. clone(Object[] array)
  2. clone(Object[] array)
  3. clone(Object[] array)
  4. clone(Object[] source)
  5. clone(Object[] src, Object[] trg)
  6. clone(T[] array)
  7. clone(T[] array)
  8. clone(T[] array)
  9. clone2DArray(double[][] a)