목록Java (3)
하이오리
[JAVA] HashMap
Import import java.util.HashMap; Source HashMap row = new HashMap(); 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"); }
JAVA/자주쓰는함수
2014. 2. 16. 22:22
[JAVA] 구분자로 잘라 순차적 출력 - StringTokenizer
Importimport java.util.StringTokenizer; SourceString str = "a,b,c,d,e,f,g";StringTokenizer tokenizer = new StringTokenizer(str, ","); while(tokenizer.hasMoreTokens()){String tk_next = tokenizer.nextToken();System.out.println(tk_next);}
JAVA/자주쓰는함수
2014. 2. 16. 22:02