extracting keys from treemap object

This question already has an answer here:

  • Iterate through a HashMap [duplicate] 7 answers

  • You're throwing away the results from your iterator. Keep the entry and you can access the key and value for printing:

    Iterator<Map.Entry<String, String>> i = emailDetailTree.entrySet().iterator();
    while(i.hasNext()) {
        Map.Entry<String, String> entry = i.next();
        ...
    
    链接地址: http://www.djcxy.com/p/17998.html

    上一篇: 如何为每个哈希映射?

    下一篇: 从树形图对象中提取键