有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Java文档映射接口描述

地图界面描述中的一段

Many methods in Collections Framework interfaces are defined in terms of the equals method. For example, the specification for the containsKey(Object key) method says: "returns true if and only if this map contains a mapping for a key k such that (key==null ? k==null : key.equals(k))."

为什么他们不使用(key==null?true:key.equals(k))而不是(key==null?k==null:key.equals(k))


共 (0) 个答案