array1 자료구조 초기화, List-Array 변환 자료구조 초기화, List-Array 변환 Array와 Map 그리고, Collection의 구현체인 List, Set의 초기화 방법을 알아본다. 그리고 필요할 때 맨날 까먹는 List와 Array간의 변환도 살펴본다. 1. 초기화 자료구조로 만들 데이터를 알고있을 때 되도록 한번에 각 자료구조를 초기화 하는 방법을 알아본다. ■ Array [Array 초기화] String[] string1 = new String[]{"hello", "hi"}; String[] string2 = {"hello", "hi"}; ■ List List.of()를 사용해서 초기화한다. [List 초기화] List stringList1 = List.of("hello", "hi"); //[1] List stringList2 = n.. 2022. 7. 15. 이전 1 다음