[Kotlin] 기본 문법 2

DTOs 생성하기

data클래스는 생성자로만 초기화 할 수 있나?

함수에 기본값 정의

fun add(name: String, email: String = "default") {
    // ...
}

Kotlin Lambdas

for문에 필터 걸기

코틀린 null처리

filterNot

String Interpolation

Map의 Key/Value를 출력하기

읽기 전용 list/map 생성하기

// Read-only list
val list = listOf("a", "b", "c")

// Read-only map
val map = mapOf("a" to 1, "b" to 2, "c" to 3)

함수 - Infix notation(중위 표기법)