// ArrayList에 들어있는 데이터를 중복 제거하기
ArrayList<String> arrList = new
ArrayList<String>();
arrList.append("중복데이터");
arrList.append("중복데이터");
arrList.append("중복데이터");
arrList.append("중복데이터");
// HashSet 데이터 형태로 생성되면서 중복 제거됨
HashSet hs = new HashSet(arrList);
// ArrayList 형태로 다시 생성
ArrayList<String> newArrList = new ArrayList<String>(hs);
'Java/JSP' 카테고리의 다른 글
| jsp 파라메터 parameter 입력 한글 깨짐 해결 (0) | 2013.03.05 |
|---|---|
| 자바 객체 Object 를 JSON 으로 변환 (0) | 2013.02.15 |
| XML to JSON 변환 방법 (0) | 2013.02.15 |
| SimpleDateFormat 이용하여 Date Calendar 날짜 가지고 놀기 (0) | 2013.02.14 |
| jdom 으로 xml 생성 하기 (0) | 2013.02.13 |