本文介绍了有人可以回答我有关HashMap的Dartlang问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
中的旧问题
- 我怎么知道哪个子类扩展了抽象类Map?
- 我的另一个问题是,由于抽象类HashMap实现了Map接口,因此它没有实现
void clear()
功能。我想知道Map接口的void clear()
函数是在哪里实现的?我在抽象的HashMap类中找不到它。
- How would I know which child class extends "abstract class Map"?
- My other question is that since abstract class HashMap implements Map interface, it does not implement
void clear()
function. I wonder where thevoid clear()
function of the Map interface is implemented? I cannot find it in abstract HashMap class.
推荐答案
您可以先阅读:
-
实现
Map
的内置类在以下列表中:
Built-in classes that implement
Map
are listed under:
HashMap HttpSession LinkedHashMap MapMixin MapView
HashMap HttpSession LinkedHashMap MapMixin MapView
如果您的意思是如何知道 Map
的工厂构造函数实例化的派生类,请再次:
If you mean how do you know which derived class is instantiated by Map
's factory constructor, again, the documentation says so:
创建一个Map实例使用默认实现LinkedHashMap。
Creates a Map instance with the default implementation, LinkedHashMap.
如果您查看。
It explicitly tells you that the clear()
implementation is inherited from a base class. If you click on it, it will take you to the class that it inherits it from.
这篇关于有人可以回答我有关HashMap的Dartlang问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!