方式1.一开始是这样的: public static void test1(List<String> list) { for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); } } 方式2.当然稍微高级一点的是这样: public static void test2(List<String> list) { for (int i = 0,lengh=list.size(); i <
Java遍历文件夹的2种方法: A.不使用递归: import java.io.File; import java.util.LinkedList; public class FileSystem { public static void main(String[] args) { long a = System.currentTimeMillis(); LinkedList list = new LinkedList(); File dir = new File("c:\\java\\&quo
一>java遍历Hashtabe: import java.util.Hashtable; import java.util.Set; public class HashTableTest { public static void main(String args[]){ Hashtable<String, String> ht = new Hashtable<String, String>(); ht.put("one", "The first