Map接口是否扩展或实现其他接口或类?

huangapple go评论86阅读模式
英文:

Does Map interface extend or implement some other interface or class?

问题

Map接口不实现Collection接口。那么Map实现或扩展了什么?它是否直接扩展了Object类?

英文:

We know that Map interface does not implement Collection interface. Then what does Map implement or extend? Does it extend Object class directly?

答案1

得分: 1

Map 不扩展任何接口;它被定义为自己的接口。

在Java中,接口 不扩展 ,只扩展其他接口。从技术上讲,Java中的所有对象都扩展自 Object,因此实现接口的任何对象都是 Object

英文:

Related question:
https://stackoverflow.com/questions/2651819/why-doesnt-java-map-extend-collection

Map does not extend any interfaces; it is defined as its own interface.

In Java, interfaces don't extend classes, only other interfaces. Technically, all objects in Java extend Object, so any object implementing an interface is an Object.

huangapple
  • 本文由 发表于 2020年8月2日 10:10:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/63211709.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定