Java 5 provides this more compact syntax:
static final Map<String , String> FLAVORS = new HashMap<String , String>() {{
put("Up", "Down");
put("Charm", "Strange");
put("Top", "Bottom");
}};
程式碼片段的網站
初始化 static map 的方法
"Java 5 provides this more compact syntax:
static final Map<String , String> FLAVORS = new HashMap<String , String>() {{
put("Up", "Down");
put("Charm", "Strange");
put("Top", "Bottom");
}};"
Java 5 provides this more compact syntax:
static final Map<String , String> FLAVORS = new HashMap<String , String>() {{
put("Up", "Down");
put("Charm", "Strange");
put("Top", "Bottom");
}};"cat txt.file | while read line
do
echo $line
done"
Items: 26 | Visits: 267
Created by: Vincent Tsao
RSpec is a Behaviour Driven ...
Items: 11 | Visits: 236
Created by: Vincent Tsao
Links to webdevelopment
Items: 252 | Visits: 195
Created by: alfred westerveld
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo