Here you can find the source of createIntArray(List extends Integer> coll)
public static int[] createIntArray(List<? extends Integer> coll)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007 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:/* ww w. j a v a 2 s.com*/ * Bruno Medeiros - initial implementation *******************************************************************************/ import java.util.List; public class Main { /** Creates an int[] from given coll of Integers. */ public static int[] createIntArray(List<? extends Integer> coll) { int[] array = new int[coll.size()]; for (int i = 0; i < coll.size(); i++) { array[i] = coll.get(i); } return array; } }