看了某个小伙伴发给我的程序,是用数组for循环的。然后之前看过一篇文章,关于大量数据的比较。测试了一下集合中关键字匹配问题。
题外:eclipse的修错真是……让人依赖性很强,要努力摆脱这种依赖。。。。还有好乱的代码代码~~~ 就不重构了~
package ForTest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.io.*;
import java.util.regex.*;
public class ForTest {
public static void main (String[] args) {
ForTest test = new ForTest();
System.out.println("============开始=============");
test.testForAndFor();
test.testMapAndList();
System.out.println("============结束=============");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private void testForAndFor() {
List<Keywords_class> keywordsList = new ArrayList<Keywords_class>();
String[] keywordString = {"abstract", "finally", "public",
"boolean", "float", "return", "break", "for", "short", "byte",
"goto", "static", "case", "if", "super", "catch", "implements",
"switch", "char", "import", "synchronized", "class",
"instanceof", "this", "cons