정리하기/DR

[Daily Report] 22.03.18 - 자바 코딩테스트 관련 문법

pythaac 2022. 3. 19. 19:31

Memo

Java 코테

l  Arrays

-       Arrays.toString()
array
를 출력을 위해 String으로 변환

-       Arrays.asList(array)
Object
arrayList로 변환

l  Stack

-       peek()
pop
하지 않고 topelt를 가져옴

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
의 모든 내용을 _toadd

-       _to = new ArrayList<>(_from)
type
immutable일 경우 가능한듯?

 

New

 

 

Things to know

탬플릿 패턴

프로토타입 패턴

페이징(Pagination)