How to convert a Collection to List?

前端 未结 10 559
不知归路
不知归路 2020-12-07 09:04

I am using TreeBidiMap from the Apache Collections library. I want to sort this on the values which are doubles.

My method is to retrieve a

10条回答
  •  青春惊慌失措
    2020-12-07 09:16

    Java 10 introduced List#copyOf which returns unmodifiable List while preserving the order:

    List list = List.copyOf(coll);
    

提交回复
热议问题