Java List to Array listToArray(List list)

Here you can find the source of listToArray(List list)

Description

list To Array

License

Open Source License

Declaration

@SuppressWarnings("rawtypes")
    private static Comparable[] listToArray(List<Comparable> list) 

Method Source Code

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

import java.util.List;

public class Main {
    @SuppressWarnings("rawtypes")
    private static Comparable[] listToArray(List<Comparable> list) {
        Comparable[] array = new Comparable[list.size()];
        int i = 0;
        for (Comparable c : list) {
            array[i] = c;//w  ww .ja  v  a 2  s.co m
            i++;
        }
        return array;
    }
}

Related

  1. listToArray(List list)
  2. listToArray(List list)
  3. listToArray(List list)
  4. listToArray(List list)
  5. listToArray(List bytes)
  6. listToArray(List doubles)
  7. listToArray(List list)
  8. listToArray(List list)
  9. ListToArray(List list)