Skip to content

Instantly share code, notes, and snippets.

@xodhx4
Created February 18, 2020 13:43
Show Gist options
  • Save xodhx4/bf898fdb39503a7d6b9bb3ac7154badc to your computer and use it in GitHub Desktop.
Save xodhx4/bf898fdb39503a7d6b9bb3ac7154badc to your computer and use it in GitHub Desktop.
[ArrayList 사용법] 기본적인 ArrayList의 사용법 #ArrayList #add #get #sort
public static void addArrayList() {
ArrayList<Integer> lists = new ArrayList<>();
for (int i =0; i<9; i++) {
lists.add(i);
}
for (int i =0; i<9; i++) {
lists.get(i);
}
}
public static void sortArray() {
ArrayList<Integer> lists = new ArrayList<>();
for (int i =0; i<9; i++) {
lists.add(sc.nextInt());
}
// TODO : ArrayList 오름차순 정렬
lists.sort(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment