Java ListIterator Usage listToStringArray(java.util.List list)

Here you can find the source of listToStringArray(java.util.List list)

Description

Get the values from specified list and return them as a string array.

License

Open Source License

Declaration

public static String[] listToStringArray(java.util.List list) 

Method Source Code

//package com.java2s;
import java.util.ListIterator;

public class Main {
    /** Get the values from specified list and return them as a string array. */
    public static String[] listToStringArray(java.util.List list) {
        if (list == null)
            return null;
        String[] result = new String[list.size()];
        ListIterator iterator = list.listIterator();
        int i = 0;
        while (iterator.hasNext()) {
            result[i] = (String) iterator.next();
            i++;/*from   w w  w  . j a v a  2 s.  c  o  m*/
        }
        return result;
    }
}

Related

  1. isEqual(java.util.List list1, java.util.List list2)
  2. iteratorBinarySearchGet(ListIterator i, int index)
  3. lastIndexOf(List list, T element)
  4. listEquals(List left, List right)
  5. listHasIdentContent(List list_1, List list_2)
  6. makeSortFieldFallbackExpr(List fieldNames)
  7. normalizeVersion(String version, int length)
  8. numberToDigits(int num)
  9. overlap(List> lists, int before, int after)