일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- LayoutManger
- 안드로이드13
- searchview
- Fragment 수동 추가
- Android
- 안드로이드개발레벨업교과서
- 뷰변경 감지
- 스와이프
- IntentTestRule
- binding adapter
- 코틀린
- 테마 아이콘
- Error:Execution failed for task ':app:mergeDebugResources'
- recyclerview
- ActivityTestRule
- 안드로이드스튜디오
- high order function
- 안드로이드
- ui test
- 구분선
- espresso
- Fragment에서 Activity의 함수 사용하기
- 리사이클러뷰
- adapter
- fragment
- 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 |
Comments