Convert Set to List without creating new List

前端 未结 15 904
鱼传尺愫
鱼传尺愫 2020-12-07 06:43

I am using this code to convert a Set to a List:

Map> mainMap = new HashMap<>();

for (int i         


        
15条回答
  •  [愿得一人]
    2020-12-07 07:26

    Recently I found this:

    ArrayList yourList = Collections.list(Collections.enumeration(yourSet));
    

提交回复
热议问题