convert String Set To Sorted Array List - Java java.lang

Java examples for java.lang:String Array

Description

convert String Set To Sorted Array List

Demo Code


//package com.java2s;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Set;

public class Main {
    static public ArrayList<String> convertStringSetToSortedArrayList(
            Set<String> aSet) {
        ArrayList<String> list = new ArrayList<String>(aSet);
        Collections.sort(list);/* w  w  w.j a  v  a 2  s .  co  m*/

        return list;
    }
}

Related Tutorials