(一)遍历
list:foreach循环
set:foreach循环
map:先用set集合得到所有key值,然后循环key得到所有vale
Map<String,String> map =
new
TreeMap<String, String>();
Set<String> sett = map.keySet();
for
(String s : sett) {
System.out.println(s+
":"
+map.get(s));
}
(二)注入
property注入:
<property name="adminEmails"> <props> <prop key="administrator">administrator@example.org</prop> <prop key="support">support@example.org</prop> <prop key="development">development@example.org</prop> </props> </property>
list注入:
<property name="someList"> <list> <value>a list element followed by a reference</value><!--第一种注入> <ref bean="myDataSource" /> <!-第二种注入-> </list> </property>
set注入:
<property name="someSet"> <set> <value>just some string</value> <ref bean="myDataSource" /> </set> </property>
map注入:
<property name="someMap"> <map> <entry key="1" value="a"> </entry> <entry key="2" value="b"> </entry> </map> </property>
Java小生店铺:
Pc端:http://shop125970977.taobao.com/index.htm
手机端:搜索 java小生店铺
希望店铺的资料能帮助到你!!!