일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- DataBinding
- 안드로이드 fcm
- OkHttp Interceptor
- 영어독립365
- 66챌린지
- Android 12 대응
- Android 12
- 영어공부
- Android Jetpack
- 안드로이드
- Android ProgressBar
- Android Interceptor
- 안드로이드 카카오 로그인
- scope function
- Android DataBinding
- Android ViewPager2
- 습관만들기
- 안드로이드 갤러리 접근
- MVP Architecture
- Android Navigation
- Java
- 카카오 알고리즘
- 알고리즘 자바
- Android WebView
- Android
- WebView
- Kotlin
- android recyclerview
- Kotlin FCM
- 프로그래머스 알고리즘
Archives
- Today
- Total
목록Higher Order Functions (1)
Developer Geek
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