Notice
Recent Posts
Recent Comments
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Archives
Today
Total
관리 메뉴

하이오리

[JAVA] HashMap 본문

JAVA/자주쓰는함수

[JAVA] HashMap

하이오리 2014. 2. 16. 22:22

Import

import java.util.HashMap; 

 

 

Source

HashMap<String,String> row = new HashMap<String,String>();

row.put("first_idx","1");

if(row.containsKey("first_idx")){ /* 해당키가 존재하는가?(boolean) */

row.put("second_idx", "2");

}else{

row.put("first_idx", "1");

row.put("second_idx", "2");

}