![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fz85vn%2FbtrTkgXCfIa%2FfrPJpr5KFsycPgqEvOkn21%2Fimg.png)
[Kotlin] 코틀린의 Scope Function (let, run, with, also, apply)
·
프로그램/KOTLIN
안녕하세요! 프뚜입니다. Scope Fuction은 객체 컨텍스트 내에서 코드 블럭을 실행할 수 있도록 해줍니다. 객체의 정보를 기본적으로 가지고 있는 코드 블럭을 만들어 사용할 수 있어 간결한 코딩을 가능하게 해줍니다. [개발 환경] - OS: Windows 10 64bit - JAVA: 11 UserEntity 생성하기 class UserEntity( private var name: String, private var age: Int ) { fun setName(param: String) { this.name = param } fun incrementAge() { this.age++ } override fun toString(): String { return "이름은 ${name}이고, 나이는 ${a..