Category Archives: HashSet

Convert HashSet of String objects to ArrayList in java (example)

Given a HashSet containing String objects in java. HashSet will be containing Sport’s name. Convert HashSet <String> to ArrayList<String> in java. We will use the constructor of ArrayList to achieve the conversion. Program – convert HashSet of Strings to ArrayList in java package org.learn.collection.set.hset; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; public class DemoHashSetToArrayList { public… Read More »