The old question in
Can somebody tell me HOW dartlang instances abstract Map class?
- 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 the void clear()
function of the Map interface is implemented? I cannot find it in abstract HashMap class.
You can start by reading the Map documentation:
Built-in classes that implement Map
are listed under:
Implementers
HashMap HttpSession LinkedHashMap MapMixin MapView
If you mean how do you know which derived class is instantiated by Map
's factory constructor, again, the documentation says so:
Map<K, V>
constructor
Creates a Map instance with the default implementation, LinkedHashMap.
If you look at the documentation for HashMap
, it says:
clear() → void
Removes all pairs from the map. [...]
inherited
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.