gpt4 book ai didi

java - TreeMap 中的 'natural ordering' 是什么?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:51:31 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How can I sort the keys of a Map in Java?

TreeMap 类中,Java API 说:

A Red-Black tree based NavigableMap implementation. The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time, depending on which constructor is used.

自然顺序是什么意思?用作键的类不必实现 Comparable 接口(interface),但将使用什么顺序来代替?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com