일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- Android Navigation
- Android ViewPager2
- MVP Architecture
- 코틀린 코루틴
- Java
- 66챌린지
- 영어독립365
- 안드로이드
- 안드로이드 카카오 로그인
- android recyclerview
- Android Interceptor
- Kotlin FCM
- 프로그래머스 알고리즘
- scope function
- Kotlin
- Android 12
- WebView
- Android ProgressBar
- 안드로이드 갤러리 접근
- DataBinding
- Android 12 대응
- Android
- 습관만들기
- Android Jetpack
- 영어공부
- 안드로이드 fcm
- 알고리즘 자바
- Android WebView
- 카카오 알고리즘
- OkHttp Interceptor
Archives
- Today
- Total
목록Higher Order Functions (1)
나미래 Android 개발자
Higher-Order Function(고차함수)란 in Kotlin
Higher-Order Functions 란 Higher-Order Functions(고차함수)란 함수의 인자로 다른 함수를 받거나 또는 함수 자체를 반환하는 함수이다. 함수 인자로 함수를 받는 고차함수 fun calculate(x: Int, y: Int, operation: (Int, Int) -> Int): Int { // 1 return operation(x, y) // 2 } fun sum(x: Int, y: Int) = x + y // 3 fun main() { val sumResult = calculate(4, 5, ::sum) // 4 val mulResult = calculate(4, 5) { a, b -> a * b } // 5 println("sumResult $sumResult, mu..
안드로이드
2022. 6. 14. 15:01