Map遍历(for、for-each、Iterator、Collection.forEach()、stream流)
几种Map遍历操作private void mapTraversal(){ HashMap<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < 5; i++) { map.put(i,-i); } // 1、在for-each循环中遍历keys或values for