Here you can find the source of copyOfRange(U[] original, int from, int to, Class extends T[]> newType)
public static <T, U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007, 2014 Bruno Medeiros and other Contributors. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from w w w . ja v a 2 s . c o m * Bruno Medeiros - initial implementation *******************************************************************************/ import java.util.Arrays; public class Main { /** Same as {@link Arrays#copyOfRange(Object[], int, int)} */ public static <T> T[] copyOfRange(T[] original, int from, int to) { return Arrays.copyOfRange(original, from, to); } /** Same as {@link Arrays#copyOfRange(Object[], int, int, Class)} */ public static <T, U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) { return Arrays.copyOfRange(original, from, to, newType); } }