일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Sprint Security
- Java
- If
- zgc
- 연산자
- Fluent-bit
- Class
- IAC
- For
- quicksort
- programmers
- g1gc
- datatype
- While
- lambda
- Kotlin
- ansible
- MergeSort
- C++
- datastructure
- JPA
- 기초
- jvm
- SpringBoot Initializr
- UserDetails
- Algorithm
- JavaScript
- 자료형
- Spring Security
- redis
Archives
- Today
- Total
목록when (1)
뭐라도 끄적이는 BLOG

Conditional expressions Kotlin은 조건식을 위해 if와 when을 제공한다. if와 when중 when을 사용하는 것을 더 추천한다. If you have to choose between if and when, we recommend using when as it leads to more robust and safer programs. - Kotlin공식 문서 if if를 사용하려면 괄호안에 조건식을 추가하고 중괄호 안에 결과가 참인 경우 수행할 작업을 추가한다. val d: Int val check = true if (check) { d = 1 } else { d = 2 } println(d) // 1 Kotlin에는 삼항 연사자(condition ? then : else)가 없..
Kotlin
2023. 7. 1. 05:53