Here you can find the source of toArray(List
Parameter | Description |
---|---|
list | a parameter |
public static int[] toArray(List<Integer> list)
//package com.java2s; /*// w ww .ja va 2 s . co m * Wegas * http://wegas.albasim.ch * * Copyright (c) 2013 School of Business and Engineering Vaud, Comem * Licensed under the MIT License */ import java.util.List; public class Main { /** * * @param list * @return */ public static int[] toArray(List<Integer> list) { int[] ret = new int[list.size()]; int i = 0; for (Integer e : list) { ret[i++] = e.intValue(); } return ret; } }