scope function (1) 썸네일형 리스트형 [Kotlin] Scope Function kotlin Scope Function에는 apply, also, with, run, let 총 5가지의 Function이 있다. 자기 자신의 객체를 반환하는 함수1. applyinline fun T.apply(block: T.() -> Unit): Tapply는 객체의 프로퍼티(속성)을 정의할 때 사용한다. val product: Product = Product().apply { // this id = 1 name = "컴퓨터" price = 1000000 category = Category.ELECTRONICS}data class Product( var id: Int = 0, var name: String = "", var price: Int = 0, va.. 이전 1 다음