Here you can find the source of clone(float[] array)
Clones an array returning a typecast result and handling null
.
Parameter | Description |
---|---|
array | the array to clone, may be <code>null</code> |
null
if null
input
public static float[] clone(float[] array)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .ja va2 s . com*/ * <p> * Clones an array returning a typecast result and handling * <code>null</code>. * </p> * * <p> * This method returns <code>null</code> for a <code>null</code> input * array. * </p> * * @param array * the array to clone, may be <code>null</code> * @return the cloned array, <code>null</code> if <code>null</code> input */ public static float[] clone(float[] array) { if (array == null) { return null; } return (float[]) array.clone(); } /** * <p> * Clones an array returning a typecast result and handling * <code>null</code>. * </p> * * <p> * This method returns <code>null</code> for a <code>null</code> input * array. * </p> * * @param array * the array to clone, may be <code>null</code> * @return the cloned array, <code>null</code> if <code>null</code> input */ public static Object[] clone(Object[] array) { if (array == null) { return null; } return array.clone(); } }