정리하기/DR
[Daily Report] 22.03.18 - 자바 코딩테스트 관련 문법
pythaac
2022. 3. 19. 19:31
Memo
Java 코테
l Arrays
- Arrays.toString()
array를 출력을 위해 String으로 변환
- Arrays.asList(array)
Object의 array를 List로 변환
l Stack
- peek()
pop하지 않고 top의 elt를 가져옴
l Comparator
- Comparator cpr = () -> {}
custom compare 함수
l String
- charAt()
index로 char를 가져옴
l ArrayList.sort(comparator)
- comparator를 넣을 때 사용
l Collections
- binarySearch
일치하는 값의 index || -(삽입 index + 1)
l ArrayList copy
- _to.addAll(_from)
_from의 모든 내용을 _to로 add
- _to = new ArrayList<>(_from)
type이 immutable일 경우 가능한듯?
New
Things to know
탬플릿 패턴
프로토타입 패턴
페이징(Pagination)