Java的在还没有发现新写法之前时,我一直是这么初始化List跟Map: //初始化List List list = new ArrayList(); list.add("string1"); list.add("string2"); //some other list.add() code...... list.add("stringN"); //初始化Map Map map = new HashMap(); map.put("key1", "value1"); map.put("key2", "value2"); //.... some other map.put() code