zoukankan      html  css  js  c++  java
  • Map遍历操作

    >>>>>>>>>>>>>>正确方法:
    Iterator<Entry<String, ArrayList<String>>> blockIterator = blockMap.entrySet().iterator(); while(blockIterator.hasNext()){ Entry<String, ArrayList<String>> entry= blockIterator.next(); String key_date = entry.getKey(); if(key_date.compareTo(sformat.format(date))<=0){ blockIterator.remove(); } }

    >>>>>>>>>>>这个方法是错误的!!!!!!!!
    for(String key_date : blockMap.keySet()){ if(key_date.compareTo(sformat.format(date))<=0){ blockMap.remove(key_date);,//不能再迭代的时候删除!!!; } }
  • 相关阅读:
    dd的用法
    od的用法
    Windows 7安装Oracle 10g的方法
    Ubuntu下的iptux和Windows下的飞秋互传文件
    c++ 12
    c++ 11
    c++ 10
    c++ 09
    c++ 08
    c++ 07
  • 原文地址:https://www.cnblogs.com/mr-level/p/5283192.html
Copyright © 2011-2022 走看看