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