问题:
If I have an object implementing the Map
interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? 如果我有一个用Java实现Map
接口的对象,并且希望对其中包含的每一对进行迭代,那么遍历该映射的最有效方法是什么?
Will the ordering of elements depend on the specific map implementation that I have for the interface? 元素的顺序是否取决于我对接口的特定映射实现?
解决方案:
参考一: https://stackoom.com/question/CCQ/如何有效地遍历Java-Map中的每个条目参考二: https://oldbug.net/q/CCQ/How-do-I-efficiently-iterate-over-each-entry-in-a-Java-Map
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4457963