Java Object Type Case castArray(Object[] array, T[] targetArray)

Here you can find the source of castArray(Object[] array, T[] targetArray)

Description

cast Array

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> T[] castArray(Object[] array, T[] targetArray) 

Method Source Code

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

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> T[] castArray(Object[] array, T[] targetArray) {
        for (int i = 0; i < array.length; i++) {
            targetArray[i] = (T) array[i];
        }//w  w  w .  j  a v a  2 s .c o  m
        return targetArray;
    }
}

Related

  1. cast(Object x)
  2. cast(Object x)
  3. cast(Object[] parameters, Class[] types)
  4. cast(String type)
  5. castAndThrow(Throwable e)
  6. castAs(Class clazz, Object obj)
  7. castAsDoubleArray(int[] input)
  8. castClass(Class aClass)
  9. castClone(U obj, T superClone)