--
This code example shows how to convert HashSet to ArrayList:
This code example shows how to convert HashSet to ArrayList:
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class HashSetToArrayList {
public static void main(String[] args) {
Set hashset = new HashSet();
hashset.add("A");
hashset.add("B");
hashset.add("C");
List list = new ArrayList(hashset);
System.out.println(list.toString());
}
}
Comments
Post a Comment