要遍历一个Hashtable,api中提供了如下几个方法可供我们遍历: keys() - returns an Enumeration of the keys of this Hashtable keySet() - returns a Set of the keys entrySet() - returns a Set of the mappings elements() - returns an Enumeration of the values of this Hashtable 4种方法…
https://yq.aliyun.com/ziliao/210955 public static void main(String[] args) { HashMap<Integer, String> map = new HashMap<Integer, String>(); for (int i = 0; i < 40000; i++) { map.put(i, "第" + i + "个"); } //循环第一种 long t1 =…
package com.test; import java.util.ArrayList;import java.util.Iterator;import java.util.List; public class ArrayListDemo { public static void main(String args[]){ List<String> list = new ArrayList<String>(); list.add("luo…