gpt4 book ai didi

Java集合规定

转载 作者:行者123 更新时间:2023-12-01 19:18:43 25 4
gpt4 key购买 nike

Java 文档对 Set 接口(interface)有以下说明,有人可以帮助我理解这些附加规定是如何强制执行的吗?我的意思是你不能抛出 super 接口(interface)(在本例中为 Collection)未抛出的额外异常。

The Set interface places additional stipulations, beyond those inherited from the Collection interface, on the contracts of all constructors and on the contracts of the add, equals and hashCode methods.

谢谢

-阿比迪

最佳答案

这些是契约(Contract)规定。

这意味着所有Set期望遵守这些规则。
它们没有被强制执行。

关于Java集合规定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5450072/

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