티스토리 뷰
public class stringArraySort { public static void main(String[] args) { String attrib; //문자열을 막 저장하는 배열, 지금은 정리되어있지만 바꿔서 테스트해보길 바람. String[] attribArray = { "book", "business", "communication", "education", "game", "image", "lifeStyle", "map", "productivity", "schedule", "sound", "stock", "utiity", "video" }; for (int i = 0; i < attribArray.length; i++) { for (int j = 0; j < i; j++) { int vs = attribArray[i].compareTo(attribArray[j]); //현재 A to Z 정렬, <= 기호를 >=로 바꾸면 Z to A 정렬 if (vs <= 0) { attrib = attribArray[i]; attribArray[i] = attribArray[j]; attribArray[j] = attrib; } } } //출력 for (int i = 0; i < attribArray.length; i++) { System.out.println(attribArray[i]); } } }
'Programming > JAVA' 카테고리의 다른 글
JsonView와 pageJsonReport의 차이점 (0) | 2013.11.27 |
---|---|
Spring Framework 개념 (0) | 2012.12.20 |
MultiActionController 예제 파일 (0) | 2012.05.16 |
코드 표기법 (0) | 2012.05.16 |
IOException : Too many open files (0) | 2011.09.16 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- isine20
- 비교
- Oracle
- OSX
- UTF-8
- password
- Too many open files
- UID
- my.cnf
- 아이패드 프로 12.9
- 이어폰
- ioexception
- 아이패드 프로 9.7
- audeze
- root
- mysql
- xcopy
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
글 보관함