일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- high order function
- 리사이클러뷰
- fragment
- recyclerview
- ActivityTestRule
- searchview
- 스와이프
- 생명주기
- Error:Execution failed for task ':app:mergeDebugResources'
- espresso
- binding adapter
- 안드로이드13
- 고차함수
- Android
- 구분선
- adapter
- Fragment 수동 추가
- ui test
- 안드로이드스튜디오
- IntentTestRule
- 안드로이드
- 테마 아이콘
- 코틀린
- 안드로이드개발레벨업교과서
- LayoutManger
- Fragment에서 Activity의 함수 사용하기
- 재사용
- viewholder
- 코딜리티
- 뷰변경 감지
Archives
- Today
- Total
룬아님의 취중코딩
Kotlin Bootcamp for Programmers 2. 조건부와 대소비교 본문
Kotlin에서는 조건부에서도 범위를 사용할 수 있습니다.
val fish = 50
if (fish in 1..100) {
println(fish)
}
⇒ 50
when (numberOfFish) {
0 -> println("Empty tank")
in 1..39 -> println("Got fish!")
else -> println("That's a lot of fish!")
}
⇒ That's a lot of fish!
반응형
'개발 > Kotlin' 카테고리의 다른 글
Kotlin Bootcamp for Programmers 4. arrays, lists, and loops (0) | 2019.09.30 |
---|---|
Kotlin Bootcamp for Programmers 3. nullability (0) | 2019.09.27 |
Kotlin Bootcamp for Programmers 1. 코틀린의 이점 (0) | 2019.09.27 |
Kotlin let을 null check에 사용하지 마라 (0) | 2019.09.22 |
Kotlin에서 let을 여러번 쓰고 싶을 때 (0) | 2019.09.10 |