์๋ฐ ๋ฐฐ์ด, ๋ฆฌ์คํธ ์ ๋ ฌ (Array, List ์ ๋ ฌ)
๋ฐฐ์ด(Array) ์ ๋ ฌ ์ค๋ฆ์ฐจ์ ์ ๋ ฌ int[] arr = {1, 2, 4, 5, 3}; Arrays.sort(arr); ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ int[] arr = {1, 2, 4, 5, 3}; Arrays.sort(arr, Collections.reverseOrder()); ์ผ๋ถ๋ง ์ ๋ ฌ int[] arr = {1, 2, 5, 4, 3};// 1 2 4 5 3 Arrays.sort(arr, 0, 4);// 1, 2, 4, 5 ์์๋ง ์ ๋ ฌ ๋ฆฌ์คํธ(List) ์ ๋ ฌ ์ค๋ฆ์ฐจ์ ์ ๋ ฌ ArrayList list = new ArrayList(Arrays.asList("c", "a", "b")); Collections.sort(list);// a b c ArrayList list = new ArrayList(Arrays.as..
2021. 11. 2.